refactor: change backend to typescript and update types and variables accordingly

This commit is contained in:
2026-07-08 10:54:07 +02:00
parent 36ec8da1a0
commit 84fa2e0ab0
24 changed files with 1911 additions and 615 deletions
+10 -5
View File
@@ -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]
}
};