add core api
This commit is contained in:
29
src/common/types.ts
Normal file
29
src/common/types.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import type { paginationQuerySchema } from "@/common/schemas";
|
||||
import type z from "zod";
|
||||
|
||||
export type PaginationQuery = z.infer<typeof paginationQuerySchema>;
|
||||
|
||||
export type SingleResponse<T> = {
|
||||
data: T;
|
||||
errors: null;
|
||||
};
|
||||
|
||||
export type ListResponse<T> = {
|
||||
data: T[];
|
||||
errors: null;
|
||||
meta: {
|
||||
page: number;
|
||||
per_page: number;
|
||||
total_pages: number;
|
||||
total_items: number;
|
||||
};
|
||||
};
|
||||
|
||||
export type ErrorResponse = {
|
||||
data: null;
|
||||
errors: {
|
||||
path?: string;
|
||||
location?: string;
|
||||
message: string;
|
||||
}[];
|
||||
};
|
||||
Reference in New Issue
Block a user