From 433b3d82b462a268cc01e909d995606c53070135 Mon Sep 17 00:00:00 2001 From: RoberTu Date: Wed, 23 Oct 2019 20:38:32 +0800 Subject: [PATCH] Sync with backend: remove "USER_FOLLOW_FAILED", add "ACTION_FAILED" --- src/common/enums/errorCode.ts | 3 ++- src/common/enums/text.ts | 4 ++-- src/components/GQL/error.tsx | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/common/enums/errorCode.ts b/src/common/enums/errorCode.ts index 900fc8912d..6501ae64a6 100644 --- a/src/common/enums/errorCode.ts +++ b/src/common/enums/errorCode.ts @@ -4,7 +4,9 @@ export const ERROR_CODES = { NETWORK_ERROR: 'NETWORK_ERROR', INTERNAL_SERVER_ERROR: 'INTERNAL_SERVER_ERROR', BAD_USER_INPUT: 'BAD_USER_INPUT', + ACTION_LIMIT_EXCEEDED: 'ACTION_LIMIT_EXCEEDED', + ACTION_FAILED: 'ACTION_FAILED', // Auth UNAUTHENTICATED: 'UNAUTHENTICATED', @@ -34,7 +36,6 @@ export const ERROR_CODES = { USER_USERNAME_INVALID: 'USER_USERNAME_INVALID', USER_USERNAME_EXISTS: 'USER_USERNAME_EXISTS', USER_DISPLAYNAME_INVALID: 'USER_DISPLAYNAME_INVALID', - USER_FOLLOW_FAILED: 'USER_FOLLOW_FAILED', // Verification Code CODE_INVALID: 'CODE_INVALID', diff --git a/src/common/enums/text.ts b/src/common/enums/text.ts index a18bf28ad9..c2bb949833 100644 --- a/src/common/enums/text.ts +++ b/src/common/enums/text.ts @@ -161,7 +161,7 @@ export const TEXT = { USER_USERNAME_INVALID: 'Matters ID 不正確', USER_USERNAME_EXISTS: '該 Matters ID 已被其他使用者使用', USER_DISPLAYNAME_INVALID: '姓名不正確', - USER_FOLLOW_FAILED: '追蹤用戶失敗,請稍候重試', + ACTION_FAILED: '操作失敗,請稍候重試', CODE_INVALID: '驗證碼不正確', CODE_EXPIRED: '驗證碼已過期' } as { [key: string]: string } @@ -329,7 +329,7 @@ export const TEXT = { USER_USERNAME_INVALID: 'Matters ID 不正确', USER_USERNAME_EXISTS: '该 Matters ID 已被其他用户使用', USER_DISPLAYNAME_INVALID: '姓名不正确', - USER_FOLLOW_FAILED: '追踪用户失败,请稍候重试', + ACTION_FAILED: '操作失败,请稍候重试', CODE_INVALID: '验证码不正确', CODE_EXPIRED: '验证码已过期' } as { [key: string]: string } diff --git a/src/components/GQL/error.tsx b/src/components/GQL/error.tsx index ddb40d281e..841d6af3ed 100644 --- a/src/components/GQL/error.tsx +++ b/src/components/GQL/error.tsx @@ -119,7 +119,8 @@ export const mutationOnError = (error: ApolloError) => { ERROR_CODES.DRAFT_NOT_FOUND, ERROR_CODES.TAG_NOT_FOUND, ERROR_CODES.NOTICE_NOT_FOUND, - ERROR_CODES.NOT_ENOUGH_MAT + ERROR_CODES.NOT_ENOUGH_MAT, + ERROR_CODES.ACTION_FAILED ] CATCH_CODES.forEach(code => { if (errorMap[code]) {