chore: initial import for test contour

This commit is contained in:
sova-bootstrap
2026-05-27 19:36:33 +03:00
commit ffd4cf9031
105 changed files with 10772 additions and 0 deletions
+38
View File
@@ -0,0 +1,38 @@
import { API, authHeader } from './apiSlice'
/*
const authHeader = () => {
const token = localStorage.getItem('token')
return token ? { Authorization: `Bearer ${token}` } : {}
}
*/
export const departmentApi = API.injectEndpoints({
endpoints: (build) => ({
getDepartments: build.query({
query: () => '/department/list',
}),
updateDepartments: build.mutation({
query: ({ departmentId, data }) => {
return ({
url: `/department/${departmentId}`,
method: 'PUT',
headers: authHeader(),
body: JSON.stringify(data),
})},
}),
createDepartments: build.mutation({
query: ({ data }) => {
return ({
url: `/department/create`,
method: 'POST',
headers: authHeader(),
body: JSON.stringify(data),
})},
}),
}),
})
export const {
useGetDepartmentsQuery,
useUpdateDepartmentsMutation,
useCreateDepartmentsMutation,
} = departmentApi