use of com.infiniteautomation.mango.rest.latest.model.user.LinkedAccountModel in project ma-modules-public by infiniteautomation.
the class UserRestController method updateLinkedAccounts.
@RequestMapping(method = RequestMethod.PUT, value = "/linked-accounts/{username}")
public void updateLinkedAccounts(@PathVariable String username, @RequestBody List<LinkedAccountModel> linkedAccountModels, @AuthenticationPrincipal PermissionHolder currentUser) {
User userToUpdate = service.get(username);
List<LinkedAccount> linkedAccounts = linkedAccountModels.stream().map(a -> mapper.unMap(a, LinkedAccount.class, currentUser)).collect(Collectors.toList());
service.updateLinkedAccounts(userToUpdate.getId(), linkedAccounts);
}
Aggregations