feat(server/types): Play around with a standardized resp type

This commit is contained in:
Taso committed 2021-04-19 14:14:25 -04:00
1 parent feb9e8a5d3
commit 16471ed1df
1 file changed
+22
+22
View File
@@ -20,3 +20,25 @@ export enum PhoneEvents {
SET_TIME = 'npwd:setGameTime',
SEND_CREDENTIALS = 'npwd:sendCredentials',
}
// Used to standardize the server response
export enum ErrorStringKeys {
SERVER_ERROR = 'GENERAL_SERVER_ERROR',
DELETE_FAILED = 'DELETE_FAILED',
ADD_FAILED = 'ADD_FAILED',
UPDATE_FAILED = 'UPDATED_FAILED',
FETCH_FAILED = 'FETCH_FAILED',
}
export interface FxServerRespError {
errorKey: ErrorStringKeys;
message: string;
}
export interface FxServerResponse {
data?: unknown;
action: string;
status: 'success' | 'failure';
app: string;
error?: FxServerRespError;
}