mirror of
https://github.com/Tria-plc/emaui.git
synced 2026-08-26 19:12:50 +00:00
feat: add account type synchronization to operations form based on selected license types
This commit is contained in:
@@ -37,6 +37,7 @@ export {
|
||||
useGetMyProfileQuery,
|
||||
useUpdateMyProfileMutation,
|
||||
useUpdateMyAddressMutation,
|
||||
useUpdateMyAccountTypeMutation,
|
||||
PROFILE_FIELDS,
|
||||
PROFILE_FIELD_SECTION,
|
||||
} from "./lib/hooks/useCurrentProfile";
|
||||
|
||||
@@ -119,6 +119,22 @@ const profileApi = baseApi
|
||||
query: ({ id, body }) => ({ url: `/profiles/${id}`, method: 'PUT', body }),
|
||||
invalidatesTags: ['CurrentProfile'],
|
||||
}),
|
||||
/**
|
||||
* The portal role — seafarer, vessel owner or logistics operator.
|
||||
*
|
||||
* Sidebar and route permissions are computed from this server-side
|
||||
* (`profiles.type`), not from the declared modes of operation, so the
|
||||
* Operations tab writes it here too. Invalidates the profile so the
|
||||
* shell repermissions itself without a reload.
|
||||
*/
|
||||
updateMyAccountType: builder.mutation<unknown, { type: string }>({
|
||||
query: (body) => ({
|
||||
url: '/profiles/me/account-type',
|
||||
method: 'PUT',
|
||||
body,
|
||||
}),
|
||||
invalidatesTags: (_result, error) => (error ? [] : ['CurrentProfile']),
|
||||
}),
|
||||
updateMyAddress: builder.mutation<
|
||||
unknown,
|
||||
{ id: string; body: Record<string, unknown> }
|
||||
@@ -134,6 +150,7 @@ export const {
|
||||
useGetMyProfileQuery,
|
||||
useUpdateMyProfileMutation,
|
||||
useUpdateMyAddressMutation,
|
||||
useUpdateMyAccountTypeMutation,
|
||||
} = profileApi;
|
||||
export const currentProfileApi = profileApi;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user