feat:add doctor page

This commit is contained in:
ARJUN S THAMPI
2026-03-17 13:11:00 +05:30
parent db8cee836a
commit 763b887d65
11 changed files with 962 additions and 34 deletions

View File

@@ -10,15 +10,11 @@ export interface Department {
services: string;
}
/* ---------------- GET ALL ---------------- */
export const getDepartmentsApi = async () => {
const res = await apiClient.get("/departments/getAll");
return res.data;
};
/* ---------------- CREATE ---------------- */
export const createDepartmentApi = async (data: {
departmentId: string;
name: string;
@@ -32,10 +28,8 @@ export const createDepartmentApi = async (data: {
return res.data;
};
/* ---------------- UPDATE ---------------- */
export const updateDepartmentApi = async (
id: number,
departmentId: string,
data: {
name?: string;
para1?: string;
@@ -45,13 +39,11 @@ export const updateDepartmentApi = async (
services?: string;
},
) => {
const res = await apiClient.put(`/departments/${id}`, data);
const res = await apiClient.put(`/departments/${departmentId}`, data);
return res.data;
};
/* ---------------- DELETE ---------------- */
export const deleteDepartmentApi = async (id: number) => {
const res = await apiClient.delete(`/departments/${id}`);
export const deleteDepartmentApi = async (departmentId: string) => {
const res = await apiClient.delete(`/departments/${departmentId}`);
return res.data;
};