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:
chamikaJ
2025-05-07 12:02:25 +05:30
parent 0fc79d9ae5
commit cabc97afc0
4 changed files with 428 additions and 108 deletions

View File

@@ -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;
},