Skip to content

Commit

Permalink
Remove ability to unset commissioned length
Browse files Browse the repository at this point in the history
  • Loading branch information
Fweddi committed Nov 4, 2024
1 parent 2283080 commit 4dacd6a
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions public/components/content-list-drawer/content-list-drawer.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,23 +332,20 @@ export function wfContentListDrawer($rootScope, config, $timeout, $window, conte
};

$scope.updateCommissionedLength = function (newValue) {
updateField("commissionedLength", newValue);
if (newValue === "") {
return wfComposerService.deleteField(
$scope.contentItem.composerId,
"commissionedLength"
);
} else if ($scope.contentItem.missingCommissionedLengthReason !== null) {
// Don't allow commissioned length to be unset
if(newValue === "") return;
if ($scope.contentItem.missingCommissionedLengthReason !== null && $scope.contentItem.missingCommissionedLengthReason !== undefined) {
updateField("missingCommissionedLengthReason", null);
wfComposerService.deleteField(
$scope.contentItem.composerId,
"missingCommissionedLengthReason"
);
}

return wfComposerService.updateField(
$scope.contentItem.composerId,
"commissionedLength",
newValue
updateField("commissionedLength", newValue);
wfComposerService.updateField(
$scope.contentItem.composerId,
"commissionedLength",
newValue
);
};

Expand Down

0 comments on commit 4dacd6a

Please sign in to comment.