Skip to content

Commit

Permalink
🐛 Update migration wave app list update to match api changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ibolton336 committed Oct 2, 2023
1 parent e4dbcf7 commit 3a11e99
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions client/src/app/pages/migration-waves/migration-waves.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ import { ConditionalRender } from "@app/components/ConditionalRender";
import { AppPlaceholder } from "@app/components/AppPlaceholder";
import { ToolbarBulkSelector } from "@app/components/ToolbarBulkSelector";
import { ConfirmDialog } from "@app/components/ConfirmDialog";
import { toRefs } from "@app/utils/model-utils";

export const MigrationWaves: React.FC = () => {
const { t } = useTranslation();
Expand Down Expand Up @@ -160,10 +161,20 @@ export const MigrationWaves: React.FC = () => {
);

const removeApplication = (migrationWave: MigrationWave, id: number) => {
migrationWave.applications = migrationWave.applications.filter(
(application) => application.id !== id
const applicationRefs = toRefs(
migrationWave.applications.filter((application) => application.id !== id)
);
updateMigrationWave(migrationWave);
const payload: MigrationWave = {
id: migrationWave.id,
name: migrationWave.name,
startDate: migrationWave.startDate,
endDate: migrationWave.endDate,
stakeholderGroups: migrationWave.stakeholderGroups,
stakeholders: migrationWave.stakeholders,
applications: applicationRefs || [],
};

updateMigrationWave(payload);
};

const tableControls = useLocalTableControls({
Expand Down

0 comments on commit 3a11e99

Please sign in to comment.