feat:add doctor page
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user