mirror of
https://github.com/Tria-plc/emaui.git
synced 2026-08-29 14:08:12 +00:00
Adding all the license feature and renewal
This commit is contained in:
@@ -14,6 +14,7 @@ import type {
|
||||
LicenseStatus,
|
||||
LicenseType,
|
||||
LicenseTypeRequirements,
|
||||
OperatorType,
|
||||
AssignableOfficer,
|
||||
DocumentDecision,
|
||||
DocumentReview,
|
||||
@@ -54,6 +55,7 @@ function serialiseQueueFilter(
|
||||
|
||||
const TAGS = [
|
||||
'LicenseType',
|
||||
'OperatorType',
|
||||
'LicenseApplication',
|
||||
'ApplicationQueue',
|
||||
'Attachment',
|
||||
@@ -84,6 +86,33 @@ export const licensingApi = baseApi
|
||||
providesTags: () => [listTag('LicenseType')],
|
||||
}),
|
||||
|
||||
/**
|
||||
* The signed-in applicant's declared modes of operation.
|
||||
*
|
||||
* Separate from the licence-type catalogue on purpose: the catalogue is
|
||||
* the same for everyone and heavily cached, while this is per-user and
|
||||
* changes the moment they edit their profile.
|
||||
*/
|
||||
getMyOperatorTypes: builder.query<{ items: OperatorType[] }, void>({
|
||||
query: () => ({ url: '/profiles/me/operations' }),
|
||||
providesTags: () => [listTag('OperatorType')],
|
||||
}),
|
||||
|
||||
/** Replaces the set — see the Operations tab in the portal profile. */
|
||||
updateMyOperatorTypes: builder.mutation<
|
||||
{ items: OperatorType[] },
|
||||
{ licenseTypeIds: string[] }
|
||||
>({
|
||||
query: (body) => ({
|
||||
url: '/profiles/me/operations',
|
||||
method: 'PUT',
|
||||
body,
|
||||
}),
|
||||
// The catalogue is filtered by this, so it has to refetch too.
|
||||
invalidatesTags: (_r, error) =>
|
||||
error ? [] : [listTag('OperatorType'), listTag('LicenseType')],
|
||||
}),
|
||||
|
||||
/**
|
||||
* Category catalogue used to group the licence cards. Static on the
|
||||
* server, so it is cached under the licence-type list tag.
|
||||
@@ -758,4 +787,6 @@ export const {
|
||||
useGetNotificationsQuery,
|
||||
useGetUnseenNotificationsQuery,
|
||||
useMarkNotificationReadMutation,
|
||||
useGetMyOperatorTypesQuery,
|
||||
useUpdateMyOperatorTypesMutation,
|
||||
} = licensingApi;
|
||||
|
||||
Reference in New Issue
Block a user