Skip to content

Commit

Permalink
update team config release device settings
Browse files Browse the repository at this point in the history
  • Loading branch information
ghernandez345 committed Mar 21, 2024
1 parent 84453cb commit 1727fe5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
10 changes: 6 additions & 4 deletions frontend/services/entities/mdm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,13 +231,15 @@ const mdmService = {
},

updateReleaseDeviceSetting: (teamId: number, isEnabled: boolean) => {
const body = {
mdm: { macos_setup: { enable_release_device_manually: isEnabled } },
};

if (teamId === API_NO_TEAM_ID) {
return configAPI.update({
mdm: { macos_setup: { enable_release_device_manually: isEnabled } },
});
return configAPI.update(body);
}

return teamAPI.update({});
return teamAPI.updateConfig(body, teamId);
},
};

Expand Down
5 changes: 3 additions & 2 deletions frontend/services/entities/teams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
API_NO_TEAM_ID,
INewTeamUsersBody,
IRemoveTeamUserBody,
ITeam,
ITeamConfig,
ITeamWebhookSettings,
} from "interfaces/team";
Expand Down Expand Up @@ -142,9 +143,9 @@ export default {
},

/**
*
* updates the team config. This can take any partial data that is in the team config.
*/
updateConfig: (data: any, teamId?: number) => {
updateConfig: (data: any, teamId: number): Promise<ITeamConfig> => {
const { TEAMS } = endpoints;
const path = `${TEAMS}/${teamId}`;
return sendRequest("PATCH", path, data);
Expand Down

0 comments on commit 1727fe5

Please sign in to comment.