doctor and pharmacies crud

This commit is contained in:
Samandar Turgunboyev
2025-11-29 19:19:40 +05:00
parent bcf9d7cd2b
commit 9bc4c3df1f
45 changed files with 3610 additions and 1469 deletions

View File

@@ -0,0 +1,36 @@
import type {
ObjectCreate,
ObjectListRes,
ObjectUpdate,
} from "@/features/objects/lib/data";
import httpClient from "@/shared/config/api/httpClient";
import { OBJECT } from "@/shared/config/api/URLs";
import type { AxiosResponse } from "axios";
export const object_api = {
async list(params: {
limit?: number;
offset?: number;
name?: string;
district?: string;
user?: string;
}): Promise<AxiosResponse<ObjectListRes>> {
const res = await httpClient.get(`${OBJECT}list/`, { params });
return res;
},
async create(body: ObjectCreate) {
const res = await httpClient.post(`${OBJECT}create/`, body);
return res;
},
async update({ body, id }: { id: number; body: ObjectUpdate }) {
const res = await httpClient.patch(`${OBJECT}${id}/update/`, body);
return res;
},
async delete(id: number) {
const res = await httpClient.delete(`${OBJECT}${id}/delete/`);
return res;
},
};