2024-04-27 16:21:14: merge [main:aa6853211bb46e321bc26b3b8132b18c03592910];
This commit is contained in:
1 parent
a31c44eb7b
commit
a6f4c85231
38 files changed
+1966
-60
No files matched your search
@@ -10,7 +10,7 @@ import { AppApiResponseType, DomainType } from '@type/app.type.ts'
|
||||
const appApi = createApi({
|
||||
reducerPath: 'appService',
|
||||
refetchOnFocus: true,
|
||||
tagTypes: ['SystemTreeApps'],
|
||||
tagTypes: ['SystemTreeApps' , 'Application'],
|
||||
baseQuery: axiosBaseQuery({ baseUrl: apiPaths.baseSystemUrl }),
|
||||
endpoints: (builder) => ({
|
||||
getSystemTree: builder.query<AppApiResponseType, void>({
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
import { createApi } from '@reduxjs/toolkit/query/react'
|
||||
|
||||
import { apiPaths } from '@constants/api/apiPaths.ts'
|
||||
|
||||
import {
|
||||
ApplicationsGroupType,
|
||||
NewApplicationsGroupType,
|
||||
UpdateApplicationsGroupType
|
||||
} from '@pages/ApplicationsPage/applications.type.ts'
|
||||
|
||||
import { axiosBaseQuery } from '@utils/apiUtils.ts'
|
||||
|
||||
const applicationsGroupApi = createApi({
|
||||
reducerPath: 'applicationsGroupApi',
|
||||
refetchOnFocus: true,
|
||||
tagTypes: ['ApplicationsGroup'],
|
||||
baseQuery: axiosBaseQuery({ baseUrl: apiPaths.baseSystemUrl }),
|
||||
endpoints: (builder) => ({
|
||||
getApplicationsGroupByDomainId: builder.query<
|
||||
ApplicationsGroupType,
|
||||
{ id: number }
|
||||
>({
|
||||
query: (id) => ({
|
||||
url: apiPaths.getServicesByDomainId,
|
||||
data: id
|
||||
}),
|
||||
providesTags: () => ['ApplicationsGroup']
|
||||
}),
|
||||
|
||||
getApplicationsGroupByServiceId: builder.query<
|
||||
ApplicationsGroupType[],
|
||||
{ id: number }
|
||||
>({
|
||||
query: (id) => ({
|
||||
url: apiPaths.getServiceById,
|
||||
data: id
|
||||
}),
|
||||
providesTags: () => ['ApplicationsGroup']
|
||||
}),
|
||||
|
||||
getAllApplicationsGroup: builder.query<
|
||||
ApplicationsGroupType[],
|
||||
{ id: string }
|
||||
>({
|
||||
query: () => ({ url: apiPaths.getAllService }),
|
||||
providesTags: () => ['ApplicationsGroup']
|
||||
}),
|
||||
|
||||
createApplicationsGroup: builder.mutation<
|
||||
ApplicationsGroupType,
|
||||
NewApplicationsGroupType
|
||||
>({
|
||||
query: (newApplicationsGroup) => ({
|
||||
url: apiPaths.createUpdateService,
|
||||
data: newApplicationsGroup
|
||||
}),
|
||||
invalidatesTags: ['ApplicationsGroup']
|
||||
}),
|
||||
|
||||
updateApplicationsGroup: builder.mutation<
|
||||
void,
|
||||
UpdateApplicationsGroupType
|
||||
>({
|
||||
query: (updateApplicationsGroup) => ({
|
||||
url: apiPaths.createUpdateService,
|
||||
data: updateApplicationsGroup
|
||||
}),
|
||||
invalidatesTags: ['ApplicationsGroup']
|
||||
}),
|
||||
|
||||
removeApplicationsGroup: builder.mutation<void, number[]>({
|
||||
query: ([id]) => ({
|
||||
url: apiPaths.deleteService,
|
||||
data: [id]
|
||||
}),
|
||||
invalidatesTags: ['ApplicationsGroup']
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
export default applicationsGroupApi
|
||||
@@ -0,0 +1,70 @@
|
||||
import { createApi } from '@reduxjs/toolkit/query/react'
|
||||
import { apiPaths } from '@constants/api/apiPaths.ts'
|
||||
|
||||
import {
|
||||
ApplicationAppType,
|
||||
ApplicationsServiceType, NewApplicationAppType,
|
||||
UpdateApplicationAppType
|
||||
} from '@pages/ApplicationsPage/applications.type.ts'
|
||||
|
||||
import { axiosBaseQuery } from '@utils/apiUtils.ts'
|
||||
|
||||
const applicationsApi = createApi({
|
||||
reducerPath: 'applicationsApi',
|
||||
refetchOnFocus: true,
|
||||
tagTypes: ['Applications'],
|
||||
baseQuery: axiosBaseQuery({ baseUrl: apiPaths.baseSystemUrl }),
|
||||
endpoints: (builder) => ({
|
||||
|
||||
getAllApplicationsService: builder.query<
|
||||
ApplicationsServiceType[],
|
||||
{ id: string }
|
||||
>({
|
||||
query: () => ({ url: apiPaths.getAllApplications }),
|
||||
providesTags: () => ['Applications']
|
||||
}),
|
||||
|
||||
createApplicationService: builder.mutation<
|
||||
ApplicationAppType,
|
||||
NewApplicationAppType
|
||||
>({
|
||||
query: ( NewApplicationsService) => ({
|
||||
url: apiPaths.createUpdateApplication,
|
||||
data: NewApplicationsService
|
||||
}),
|
||||
invalidatesTags: ['Applications']
|
||||
}),
|
||||
|
||||
getApplicationsServiceById: builder.query<ApplicationsServiceType, { id : number}>({
|
||||
query: (id) => ({
|
||||
url: apiPaths.getApplicationById,
|
||||
data: id
|
||||
}),
|
||||
}),
|
||||
|
||||
getApplicationsByServiceId: builder.query<ApplicationsServiceType[], { id : number}>({
|
||||
query: (id) => ({
|
||||
url: apiPaths.getApplicationsByServiceId,
|
||||
data: id
|
||||
}),
|
||||
}),
|
||||
|
||||
updateApplicationsService: builder.mutation<void, UpdateApplicationAppType>({
|
||||
query: (updateApplications) => ({
|
||||
url: apiPaths.createUpdateApplication,
|
||||
data: updateApplications
|
||||
}),
|
||||
invalidatesTags: ['Applications']
|
||||
}),
|
||||
|
||||
removeApplicationsService: builder.mutation<void, number[]>({
|
||||
query: ([id]) => ({
|
||||
url: apiPaths.deleteApplication,
|
||||
data: [ id]
|
||||
}),
|
||||
invalidatesTags: ['Applications']
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
export default applicationsApi
|
||||
@@ -0,0 +1,29 @@
|
||||
import { createApi } from '@reduxjs/toolkit/query/react'
|
||||
|
||||
import { apiPaths } from '@constants/api/apiPaths.ts'
|
||||
|
||||
import { ModuleType } from '@pages/ModulesPage/module.type.ts'
|
||||
|
||||
import { axiosBaseQuery } from '@utils/apiUtils.ts'
|
||||
|
||||
const modulesServiceApi = createApi({
|
||||
reducerPath: 'modulesServiceApi',
|
||||
refetchOnFocus: true,
|
||||
tagTypes: ['modules'],
|
||||
baseQuery: axiosBaseQuery({ baseUrl: apiPaths.baseConfigUrl }),
|
||||
endpoints: (builder) => ({
|
||||
getModules: builder.query<ModuleType[], string>({
|
||||
query: () => ({ url: apiPaths.getModules, data: { limit: 1000 } }),
|
||||
providesTags: () => ['modules']
|
||||
}),
|
||||
removeModule: builder.mutation<void, string>({
|
||||
query: (id) => ({
|
||||
url: apiPaths.deleteModule,
|
||||
data: [id]
|
||||
}),
|
||||
invalidatesTags: ['modules']
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
export default modulesServiceApi
|
||||
@@ -0,0 +1,30 @@
|
||||
import { createApi } from '@reduxjs/toolkit/query/react'
|
||||
import { apiPaths } from '@constants/api/apiPaths.ts'
|
||||
|
||||
import {
|
||||
ApplicationTokenType,
|
||||
NewApplicationTokenType,
|
||||
} from '@pages/ApplicationsPage/applications.type.ts'
|
||||
|
||||
import { axiosBaseQuery } from '@utils/apiUtils.ts'
|
||||
|
||||
const tokensApi = createApi({
|
||||
reducerPath: 'tokensApi',
|
||||
refetchOnFocus: true,
|
||||
tagTypes: ['Tokens'],
|
||||
baseQuery: axiosBaseQuery({ baseUrl: apiPaths.baseSystemUrl }),
|
||||
endpoints: (builder) => ({
|
||||
createToken: builder.mutation<
|
||||
ApplicationTokenType,
|
||||
NewApplicationTokenType
|
||||
>({
|
||||
query: ( NewApplicationTokenType) => ({
|
||||
url: apiPaths.createToken,
|
||||
data: NewApplicationTokenType
|
||||
}),
|
||||
invalidatesTags: ['Tokens']
|
||||
}),
|
||||
})
|
||||
})
|
||||
|
||||
export default tokensApi
|
||||
Reference in new issue
Block a user