File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed
Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -48,9 +48,7 @@ module Persistence =
4848 s.FollowingUserId = userId)
4949 } |> Seq.tryHeadAsync |> AR.catch
5050
51- match relationship with
52- | Some _ -> return true
53- | _ -> return false
51+ return relationship.IsSome
5452 }
5553
5654module GetStream =
Original file line number Diff line number Diff line change @@ -2,15 +2,16 @@ $(function(){
22 $ ( "#follow" ) . on ( 'click' , function ( ) {
33 var $this = $ ( this ) ;
44 var userId = $this . data ( 'user-id' ) ;
5- $this . prop ( 'disabled' , true ) ;
65 $ . ajax ( {
76 url : "/follow" ,
87 type : "post" ,
98 data : JSON . stringify ( { userId : userId } ) ,
109 contentType : "application/json"
1110 } ) . done ( function ( ) {
1211 alert ( "successfully followed" ) ;
13- $this . prop ( 'disabled' , false ) ;
12+ $this . attr ( 'id' , 'unfollow' ) ;
13+ $this . html ( 'Following' ) ;
14+ $this . addClass ( 'disabled' ) ;
1415 } ) . fail ( function ( jqXHR , textStatus , errorThrown ) {
1516 console . log ( { jqXHR : jqXHR , textStatus : textStatus , errorThrown : errorThrown } )
1617 alert ( "something went wrong!" )
You can’t perform that action at this time.
0 commit comments