Skip to content

Commit

Permalink
Save changes to notifySchemaChangesByEmail field when patching a sync…
Browse files Browse the repository at this point in the history
… (#5918)
  • Loading branch information
chandlerprall committed Apr 27, 2023
1 parent e7371ab commit b24a549
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,10 @@ private static void applyPatchToStandardSync(final StandardSync sync, final Conn
sync.setNotifySchemaChanges(patch.getNotifySchemaChanges());
}

if (patch.getNotifySchemaChangesByEmail() != null) {
sync.setNotifySchemaChangesByEmail(patch.getNotifySchemaChangesByEmail());
}

if (patch.getNonBreakingChangesPreference() != null) {
sync.setNonBreakingChangesPreference(ApiPojoConverters.toPersistenceNonBreakingChangesPreference(patch.getNonBreakingChangesPreference()));
}
Expand Down Expand Up @@ -624,21 +628,21 @@ private static String getFrequencyStringFromScheduleType(final ScheduleType sche
}
}

public ConnectionReadList listConnectionsForWorkspaces(ListConnectionsForWorkspacesRequestBody listConnectionsForWorkspacesRequestBody)
public ConnectionReadList listConnectionsForWorkspaces(final ListConnectionsForWorkspacesRequestBody listConnectionsForWorkspacesRequestBody)
throws IOException {

final List<ConnectionRead> connectionReads = Lists.newArrayList();

Map<UUID, List<StandardSync>> workspaceIdToStandardSyncsMap = configRepository.listWorkspaceStandardSyncsPaginated(
final Map<UUID, List<StandardSync>> workspaceIdToStandardSyncsMap = configRepository.listWorkspaceStandardSyncsPaginated(
listConnectionsForWorkspacesRequestBody.getWorkspaceIds(),
listConnectionsForWorkspacesRequestBody.getIncludeDeleted(),
PaginationHelper.pageSize(listConnectionsForWorkspacesRequestBody.getPagination()),
PaginationHelper.rowOffset(listConnectionsForWorkspacesRequestBody.getPagination()));

for (final Entry<UUID, List<StandardSync>> entry : workspaceIdToStandardSyncsMap.entrySet()) {
UUID workspaceId = entry.getKey();
for (StandardSync standardSync : entry.getValue()) {
ConnectionRead connectionRead = ApiPojoConverters.internalToConnectionRead(standardSync);
final UUID workspaceId = entry.getKey();
for (final StandardSync standardSync : entry.getValue()) {
final ConnectionRead connectionRead = ApiPojoConverters.internalToConnectionRead(standardSync);
connectionRead.setWorkspaceId(workspaceId);
connectionReads.add(connectionRead);
}
Expand Down

0 comments on commit b24a549

Please sign in to comment.