Skip to content

Commit 6e2061d

Browse files
authored
[O2B-1201] Extract lhcPeriod from patch and not relations (#1472)
Notable changes for users: - At the first SB today, we have observed an issue in which lhcPeriodName was not being saved in Bookkeeping Notable changes for developers: - this was due to the lhcPeriod string from ECS being extracted from relations instead of patch which resulted in a null lhcPeriod being saved
1 parent 945498e commit 6e2061d

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

lib/server/controllers/gRPC/GRPCRunController.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ class GRPCRunController {
6161
eorReasons: relations.eorReasons,
6262
userO2Start: relations.userO2Start,
6363
userO2Stop: relations.userO2Stop,
64+
lhcPeriodName: relations.lhcPeriod?.name,
6465
},
6566
},
6667
));
@@ -118,8 +119,10 @@ class GRPCRunController {
118119
delete gRPCRunRequest.userO2Stop;
119120
}
120121

121-
const { lhcPeriod } = gRPCRunRequest;
122-
gRPCRunRequest.lhcPeriod = lhcPeriod ? { name: lhcPeriod } : lhcPeriod;
122+
if (gRPCRunRequest.lhcPeriod) {
123+
relations.lhcPeriod = { name: gRPCRunRequest.lhcPeriod };
124+
delete gRPCRunRequest.lhcPeriod;
125+
}
123126

124127
return { run: gRPCRunRequest, relations };
125128
}

0 commit comments

Comments
 (0)