This commit is contained in:
2026-03-27 16:20:46 +03:00
commit 13b56d4960
260 changed files with 111131 additions and 0 deletions
+8
View File
@@ -0,0 +1,8 @@
import { ApiBaseResponse, ApiListQueryParams } from "./types"
export interface CrudOperations {
list: <T>(params: ApiListQueryParams) => Promise<ApiBaseResponse<T>>
create: <T>(payload: unknown) => Promise<ApiBaseResponse<T>>
update: <T>(id: string, payload: unknown) => Promise<ApiBaseResponse<T>>
destroy: <T>(id: string) => Promise<ApiBaseResponse<T>>
}
+19
View File
@@ -0,0 +1,19 @@
export type ApiBaseResponse<T> = {
data: T;
meta: {
current_page: number,
last_page: number,
per_page: number,
total: number,
from: number,
to: number
}
}
export type ApiListQueryParams = {
page?: number;
per_page?: number;
sort_by?: string;
sort_order?: 'asc' | 'desc';
[key: string]: any; // For additional filters
}