File tree Expand file tree Collapse file tree 3 files changed +4
-7
lines changed Expand file tree Collapse file tree 3 files changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -12,13 +12,11 @@ import { themedPalette } from '../../lib/styles/themes';
12
12
export interface PostFollowButtonProps {
13
13
followingUserId : string ;
14
14
followed : boolean | undefined ;
15
- postId : string ;
16
15
}
17
16
18
17
const FollowButton : React . FC < PostFollowButtonProps > = ( {
19
18
followingUserId,
20
19
followed,
21
- postId,
22
20
} ) => {
23
21
const client = useApolloClient ( ) ;
24
22
const currentUser = useUser ( ) ;
@@ -52,7 +50,6 @@ const FollowButton: React.FC<PostFollowButtonProps> = ({
52
50
53
51
const variables = {
54
52
following_user_id : followingUserId ,
55
- post_id : postId ,
56
53
} ;
57
54
58
55
const followFragment = gql `
Original file line number Diff line number Diff line change @@ -429,7 +429,6 @@ const PostViewer: React.FC<PostViewerProps> = ({
429
429
< FollowButton
430
430
followed = { post . user . is_followed }
431
431
followingUserId = { post . user . id }
432
- postId = { post . id }
433
432
/>
434
433
}
435
434
/>
@@ -447,7 +446,6 @@ const PostViewer: React.FC<PostViewerProps> = ({
447
446
< FollowButton
448
447
followed = { post . user . is_followed }
449
448
followingUserId = { post . user . id }
450
- postId = { post . id }
451
449
/>
452
450
}
453
451
/>
Original file line number Diff line number Diff line change @@ -185,16 +185,18 @@ export const CONFIRM_CHANGE_EMAIL = gql`
185
185
186
186
export const FOLLOW_USER = gql `
187
187
mutation Follow($following_user_id: ID!, $post_id: ID!) {
188
- follow(following_user_id: $following_user_id, post_id: $post_id ) {
188
+ follow(following_user_id: $following_user_id) {
189
189
id
190
+ is_followed
190
191
}
191
192
}
192
193
` ;
193
194
194
195
export const UNFOLLOW_USER = gql `
195
196
mutation Unfollow($following_user_id: ID!, $post_id: ID!) {
196
- unfollow(following_user_id: $following_user_id, post_id: $post_id ) {
197
+ unfollow(following_user_id: $following_user_id) {
197
198
id
199
+ is_followed
198
200
}
199
201
}
200
202
` ;
You can’t perform that action at this time.
0 commit comments