server overhaul, new jwt strategy, some various patches

This commit is contained in:
Mikayla Dobson
2023-02-11 16:25:30 -06:00
parent 7aa5e80d4d
commit 3af0af8066
21 changed files with 160 additions and 103 deletions

View File

@@ -8,10 +8,14 @@ export default class ControllerResponse<T> implements CtlResponse<T> {
constructor(code: StatusCode, data: T | string, ok?: boolean) {
this.code = code
this.data = data
this.ok = ok || (this.data !== null)
this.ok = ok ?? (this.data !== null)
}
send() {
return { ok: this.ok, code: this.code, data: this.data }
}
represent() {
console.log({ ok: this.ok, code: this.code, data: this.data });
}
}