Skip to content

Instantly share code, notes, and snippets.

@rasikag
Created March 16, 2021 18:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rasikag/0136d2bb76276ec5bd3b7fd15e4feaa6 to your computer and use it in GitHub Desktop.
Save rasikag/0136d2bb76276ec5bd3b7fd15e4feaa6 to your computer and use it in GitHub Desktop.
// take out toErrorMap first
const errorMap = toErrorMap(response.data.changePassword.errors);
if ('token' in errorMap) {
// this is because we defined filed as token in user.ts in backend
setTokenError(errorMap.token)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment