File tree Expand file tree Collapse file tree 2 files changed +4
-22
lines changed Expand file tree Collapse file tree 2 files changed +4
-22
lines changed Original file line number Diff line number Diff line change @@ -47,12 +47,10 @@ const Vote = (props) => {
4747 setVoted ( false )
4848 setVotes ( ( votes ) => votes - 1 )
4949 } else {
50- const response = await userStory . updateStoryVote (
51- story . id ,
52- followers ,
53- userId
54- )
55- const updatedFollowerIds = response . data . data . updateUserStory . userStory . followers . map (
50+ followers . push ( JSON . stringify ( userId ) )
51+ let updatedFollowerIds = followers
52+ const response = await userStory . updateVotes ( story . id , updatedFollowerIds )
53+ updatedFollowerIds = response . data . data . updateUserStory . userStory . followers . map (
5654 ( follower ) => JSON . stringify ( follower . id )
5755 )
5856 setFollowers ( updatedFollowerIds )
Original file line number Diff line number Diff line change @@ -442,22 +442,6 @@ const userStory = {
442442 `
443443 }
444444 return apiCall ( '/graphql' , updateVotesQuery )
445- } ,
446- updateStoryVote : ( storyId , followers , userId ) => {
447- const updateStoryVoteQuery = {
448- query : `
449- mutation {
450- updateUserStory(input: {where: {id: "${ storyId } "} data: {followers: [${ followers } , "${ userId } "]}}){
451- userStory{
452- followers {
453- id
454- }
455- }
456- }
457- }
458- `
459- }
460- return apiCall ( '/graphql' , updateStoryVoteQuery )
461445 }
462446}
463447
You can’t perform that action at this time.
0 commit comments