mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 06:28:51 +00:00
feat(server/types): Play around with a standardized resp type
This commit is contained in:
1 parent
0bb20fff31
commit
b684656379
1 file changed
+22
@@ -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;
|
||||
}
|
||||
Reference in new issue
Block a user