| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- /*
- export class ResultDto<T = any> {
- ok: boolean;
- status: number;
- message?: string|null;
- data: T|null;
- errors?: Record<string, string[]>|null;
- constructor({
- ok = false,
- status = 500,
- message = null,
- data = null,
- errors = null
- }: Partial<ResultDto<T>>) {
- this.ok = ok;
- this.status = status;
- this.message = message;
- this.data = data;
- this.errors = errors;
- }
- public getError(index: number = 0): string|undefined {
- if (this.errors) {
- const errorKeys = Object.keys(this.errors);
- if (errorKeys.length > 0) {
- const key = errorKeys[index];
- if (key) {
- return this.errors[key][0];
- }
- }
- }
- return undefined;
- }
- };
- */
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- export interface ResultDto<T = any> {
- ok: boolean;
- status: number;
- message: string|null;
- data: T|null;
- errors: Record<string, string[]>|null;
- }
- export interface TokenData {
- id: string;
- email: string;
- name: string|null;
- }
|