chore: file formatting

This commit is contained in:
Kailasdevdas
2026-05-26 15:48:01 +05:30
parent 8a21e0bf38
commit 78e2618a29
117 changed files with 12775 additions and 14638 deletions
+11 -17
View File
@@ -1,5 +1,5 @@
import apiClient from "@/api/client";
import toast from "react-hot-toast";
import apiClient from '@/api/client';
import toast from 'react-hot-toast';
export interface Department {
departmentId: string;
@@ -15,7 +15,7 @@ export interface Department {
}
export const getDepartmentsApi = async () => {
const res = await apiClient.get("/departments/getAll?admin=true");
const res = await apiClient.get('/departments/getAll?admin=true');
return res.data;
};
@@ -29,15 +29,13 @@ export const createDepartmentApi = async (data: {
services?: string;
}) => {
try {
const res = await apiClient.post("/departments", data);
const res = await apiClient.post('/departments', data);
toast.success("Department created successfully");
toast.success('Department created successfully');
return res.data;
} catch (error: any) {
toast.error(
error?.response?.data?.message || "Failed to create department",
);
toast.error(error?.response?.data?.message || 'Failed to create department');
throw error;
}
@@ -52,18 +50,16 @@ export const updateDepartmentApi = async (
para3?: string;
facilities?: string;
services?: string;
},
}
) => {
try {
const res = await apiClient.put(`/departments/${departmentId}`, data);
toast.success("Department updated successfully");
toast.success('Department updated successfully');
return res.data;
} catch (error: any) {
toast.error(
error?.response?.data?.message || "Failed to update department",
);
toast.error(error?.response?.data?.message || 'Failed to update department');
throw error;
}
@@ -73,13 +69,11 @@ export const deleteDepartmentApi = async (departmentId: string) => {
try {
const res = await apiClient.delete(`/departments/${departmentId}`);
toast.success("Department deleted successfully");
toast.success('Department deleted successfully');
return res.data;
} catch (error: any) {
toast.error(
error?.response?.data?.message || "Failed to delete department",
);
toast.error(error?.response?.data?.message || 'Failed to delete department');
throw error;
}