From f19f66d4992bab756f97209689a6dd41d7bbe7b2 Mon Sep 17 00:00:00 2001 From: afonso pinto Date: Thu, 14 Nov 2024 12:52:49 +0000 Subject: [PATCH] SCKAN-323 fix: Update frontend to send new owner_id on retry --- frontend/src/services/StatementService.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/frontend/src/services/StatementService.ts b/frontend/src/services/StatementService.ts index 5f51af7d..81dd2397 100644 --- a/frontend/src/services/StatementService.ts +++ b/frontend/src/services/StatementService.ts @@ -49,10 +49,9 @@ class ConnectivityStatementService extends AbstractService { return await checkOwnership( id, // Retry the update after ownership is reassigned, including new owner ID - async () => { - const updatedStatement = { - ...connectivityStatement, - }; + async (fetchedData, userId) => { + // Update the statement with the new ownership if reassigned + const updatedStatement = { ...connectivityStatement, owner_id: userId }; await composerApi.composerConnectivityStatementUpdate(id, updatedStatement).then((response: any) => response.data); return ChangeRequestStatus.SAVED; },