refactor: change backend to typescript and update types and variables accordingly
This commit is contained in:
@@ -1,9 +1,14 @@
|
||||
export const returnErrorCode = (errorKey) => {
|
||||
import type {ErrorCode} from "../misc/types.ts";
|
||||
|
||||
export const returnErrorCode = (errorKey: ErrorCode) => {
|
||||
if (!Array.isArray(errorKey) || errorKey.length < 2) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return {code: errorKey[0], message: errorKey[1], data: null};
|
||||
};
|
||||
|
||||
export default returnErrorCode;
|
||||
return {
|
||||
success: false,
|
||||
code: errorKey[0],
|
||||
data: null,
|
||||
message: errorKey[1]
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user