mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-05 06:28:51 +00:00
feat(server/types): Play around with a standardized resp type
This commit is contained in:
1 parent
feb9e8a5d3
commit
16471ed1df
1 file changed
+22
@@ -20,3 +20,25 @@ export enum PhoneEvents {
|
|||||||
SET_TIME = 'npwd:setGameTime',
|
SET_TIME = 'npwd:setGameTime',
|
||||||
SEND_CREDENTIALS = 'npwd:sendCredentials',
|
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