File size: 455 Bytes
721abf7
e9affa5
 
721abf7
 
 
 
 
e9affa5
 
 
 
721abf7
e9affa5
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
export type IJSONSuccessResponseProps<T extends Record<string, any> | Record<string, any>[]> = {
  status?: number;
  message?: string;
  data?: T | null;
}
& 
(T extends any[] ? {
  meta:  {
    total: number;
    page: number;
    perPage: number;
  };
} : {});

export interface IJSONErrorResponseProps {
  status?: number;
  message?: string;
  error: string;
}

export interface IJSONValidationErrorResponseProps {
  errors: Record<string, any>[];
}