if (workspace == null) {
respondWithNotFound(response);
return;
}
ClientApiWorkspaceUpdateData updateData = ObjectMapperFactory.getInstance().readValue(data, ClientApiWorkspaceUpdateData.class);
if (updateData.getTitle() != null) {
setTitle(workspace, updateData.getTitle(), authUser);
}
updateEntities(workspace, updateData.getEntityUpdates(), authUser);
deleteEntities(workspace, updateData.getEntityDeletes(), authUser);
updateUsers(workspace, updateData.getUserUpdates(), authUser);
workspace = workspaceRepository.findById(workspaceId, authUser);
ClientApiWorkspace clientApiWorkspaceAfterUpdateButBeforeDelete = workspaceRepository.toClientApi(workspace, authUser, false);
workQueueRepository.pushWorkspaceChange(clientApiWorkspaceAfterUpdateButBeforeDelete);
deleteUsers(workspace, updateData.getUserDeletes(), authUser);
respondWithSuccessJson(response);
}