Enhance team update logic and error handling
- Refactored the team update function in the Admin Center controller to improve error handling and response messages. - Implemented concurrent updates for team member roles using Promise.all, enhancing performance and user experience. - Updated the frontend API service to accept a structured body for team updates, ensuring consistency in data handling. - Enhanced the settings drawer component to manage team member roles more effectively, improving the overall user interface.
This commit is contained in:
@@ -112,11 +112,11 @@ export const adminCenterApiService = {
|
||||
|
||||
async updateTeam(
|
||||
team_id: string,
|
||||
team_members: IOrganizationUser[]
|
||||
body: {name: string, teamMembers: IOrganizationUser[]}
|
||||
): Promise<IServerResponse<IOrganization>> {
|
||||
const response = await apiClient.put<IServerResponse<IOrganization>>(
|
||||
`${rootUrl}/organization/team/${team_id}`,
|
||||
team_members
|
||||
body
|
||||
);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user