Spaces:
Running
Running
File size: 526 Bytes
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 25 26 27 |
interface IJSONResponse {
status: number;
message: string;
}
export type IJSONSuccessResponse<T extends Record<string, any> | Record<string, any>[]> = IJSONResponse & {
data: T;
}
&
(T extends any[] ? {
meta: {
total: number;
page: number;
perPage: number;
};
} : {});
export interface IJSONErrorResponse extends IJSONResponse {
error: string;
}
export interface IJSONValidationErrorResponse extends IJSONResponse {
status: 422;
message: "Validation Error";
errors: Record<string, any>[];
}
|