mirror of
https://github.com/Tria-plc/emaui.git
synced 2026-08-29 17:38:14 +00:00
sending params on configation api call on professions
This commit is contained in:
@@ -1,41 +1,41 @@
|
||||
import { baseApi } from '@ema-platform/api';
|
||||
import { baseApi } from "@ema-platform/api";
|
||||
import type {
|
||||
Organization,
|
||||
Profession,
|
||||
ListResponse,
|
||||
CreateProfessionPayload,
|
||||
UpdateProfessionPayload,
|
||||
} from '../types/configuration';
|
||||
} from "../types/configuration";
|
||||
|
||||
const configurationApi = baseApi.injectEndpoints({
|
||||
endpoints: (builder) => ({
|
||||
getOrganizations: builder.query<ListResponse<Organization>, void>({
|
||||
query: () => '/organizations',
|
||||
providesTags: ['Api'],
|
||||
query: () => "/organizations",
|
||||
providesTags: ["Api"],
|
||||
}),
|
||||
|
||||
getProfessions: builder.query<
|
||||
ListResponse<Profession>,
|
||||
{ skip?: number; take?: number; q?: string; orderBy?: string } | void
|
||||
>({
|
||||
query: (arg) => ({ url: '/professions', params: arg ?? {} }),
|
||||
providesTags: ['Api'],
|
||||
getProfessions: builder.query<ListResponse<Profession>, { q?: string }>({
|
||||
query: (params) => ({
|
||||
url: "/professions",
|
||||
params,
|
||||
}),
|
||||
providesTags: ["Api"],
|
||||
}),
|
||||
createProfession: builder.mutation<Profession, CreateProfessionPayload>({
|
||||
query: (body) => ({ url: '/professions', method: 'POST', body }),
|
||||
invalidatesTags: ['Api'],
|
||||
query: (body) => ({ url: "/professions", method: "POST", body }),
|
||||
invalidatesTags: ["Api"],
|
||||
}),
|
||||
updateProfession: builder.mutation<Profession, UpdateProfessionPayload>({
|
||||
query: ({ id, ...body }) => ({
|
||||
url: `/professions/${id}`,
|
||||
method: 'PUT',
|
||||
method: "PUT",
|
||||
body,
|
||||
}),
|
||||
invalidatesTags: ['Api'],
|
||||
invalidatesTags: ["Api"],
|
||||
}),
|
||||
deleteProfession: builder.mutation<void, string>({
|
||||
query: (id) => ({ url: `/professions/${id}`, method: 'DELETE' }),
|
||||
invalidatesTags: ['Api'],
|
||||
query: (id) => ({ url: `/professions/${id}`, method: "DELETE" }),
|
||||
invalidatesTags: ["Api"],
|
||||
}),
|
||||
}),
|
||||
overrideExisting: true,
|
||||
|
||||
Reference in New Issue
Block a user