Last active
August 27, 2020 13:17
-
-
Save felippepuhle/bbedfc6685fd67587af9aedabd57afa3 to your computer and use it in GitHub Desktop.
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
import { UserAPI } from '@datasources' | |
import { GraphQLType, getGlobalId, updateLocalUser } from '@relay' | |
// ... | |
const onPressBlockUser = useCallback(async (blockedUserId: string) => { | |
await UserAPI.blockUser({ blockedUserId }) | |
updateLocalUser( | |
getGlobalId({ type: GraphQLType.USER, resourceId: blockedUserId }), | |
() => ({ isBlocked: true }) | |
) | |
}, []) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment