feat(web-organizations): add organization detail editing and isolate detail view state from global navigation
This commit is contained in:
@@ -276,6 +276,30 @@ export const createOrganizationAction = organizationsStatePart.createAction<{
|
||||
}
|
||||
});
|
||||
|
||||
export const updateOrganizationAction = organizationsStatePart.createAction<{
|
||||
organizationId: string;
|
||||
displayName?: string;
|
||||
description?: string;
|
||||
website?: string;
|
||||
isPublic?: boolean;
|
||||
}>(async (statePartArg, dataArg) => {
|
||||
const context = getActionContext();
|
||||
if (!context.identity) return statePartArg.getState();
|
||||
try {
|
||||
const typedRequest = createTypedRequest<interfaces.requests.IReq_UpdateOrganization>(
|
||||
'updateOrganization',
|
||||
);
|
||||
const response = await typedRequest.fire({
|
||||
identity: context.identity,
|
||||
...dataArg,
|
||||
});
|
||||
// Update the current org in state
|
||||
return { ...statePartArg.getState(), currentOrg: response.organization };
|
||||
} catch {
|
||||
return statePartArg.getState();
|
||||
}
|
||||
});
|
||||
|
||||
export const deleteOrganizationAction = organizationsStatePart.createAction<{
|
||||
organizationId: string;
|
||||
}>(async (statePartArg, dataArg) => {
|
||||
|
||||
Reference in New Issue
Block a user