-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: replace restful api to graphql (#1472)
- Loading branch information
Showing
8 changed files
with
63 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,17 @@ | ||
import { useAsyncFn } from 'react-use'; | ||
import { useToken } from 'hooks/auth'; | ||
import { getExperienceReply as getExperienceReplyApi } from 'apis/experiencesApi'; | ||
import { queryExperienceReplies } from 'apis/experiencesApi'; | ||
|
||
const useQueryReplies = experienceId => { | ||
const token = useToken(); | ||
return useAsyncFn(async () => { | ||
const result = await getExperienceReplyApi({ | ||
experienceId, | ||
start: 0, | ||
limit: 100, | ||
token, | ||
}); | ||
|
||
return result.replies; | ||
}, [experienceId, token]); | ||
return useAsyncFn( | ||
() => | ||
queryExperienceReplies({ | ||
id: experienceId, | ||
token, | ||
}), | ||
[experienceId, token], | ||
); | ||
}; | ||
|
||
export default useQueryReplies; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters