Skip to content

Commit

Permalink
Merge pull request #459 from intersective/bugfix/CORE-6710/Invalid-va…
Browse files Browse the repository at this point in the history
…lue-error-on-updating-metric-details-trunk

[CORE-6710] "Invalid Value" Error when Amending and Saving Metric change
  • Loading branch information
sasangachathumal authored Aug 1, 2024
2 parents 5b76547 + 5ad49ec commit 8a58477
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/app/metrics/update-metric/update-metric.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,14 @@ export class UpdateMetricComponent implements AfterViewInit, OnDestroy {
});

if (this.metricForm.value.uuid) {
if (this.metricForm.value.status === 'inactive') {
delete this.metricForm.value.status;
}
return this.metricsService.saveMetric(this.metricForm.value)
.pipe(takeUntil(this.unsubscribe$)).subscribe(() => {
this.dismissModal();
this.toastController.create({
message: 'Metric added successfully.',
message: 'Metric updated successfully.',
duration: 1500,
position: 'top',
color: 'success',
Expand All @@ -106,7 +109,7 @@ export class UpdateMetricComponent implements AfterViewInit, OnDestroy {
this.dismissModal();

this.toastController.create({
message: 'Metric updated successfully.',
message: 'Metric added successfully.',
duration: 1500,
position: 'top',
color: 'success',
Expand Down

0 comments on commit 8a58477

Please sign in to comment.