Skip to content

Commit

Permalink
Merge pull request #2030 from bcgov/feature/ALCS-2432
Browse files Browse the repository at this point in the history
Show Successful Toast When Condition Type is Updated in Admin
  • Loading branch information
Abradat authored Dec 18, 2024
2 parents ebad124 + be75326 commit e04783f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,15 @@ export class ApplicationDecisionConditionTypesService {

async update(code: string, updateDto: ApplicationDecisionConditionTypeDto) {
try {
return await firstValueFrom(
const updatedDecisionConditionType = await firstValueFrom(
this.http.patch<ApplicationDecisionConditionTypeDto>(`${this.url}/${code}`, updateDto),
);

if (updatedDecisionConditionType) {
this.toastService.showSuccessToast('Condition type updated successfully');
}

return updatedDecisionConditionType;
} catch (e) {
this.toastService.showErrorToast('Failed to update decision condition type');
console.error(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,15 @@ export class NoticeofIntentDecisionConditionTypesService {

async update(code: string, updateDto: NoticeOfIntentDecisionConditionTypeDto) {
try {
return await firstValueFrom(
const updatedDecisionConditionType = await firstValueFrom(
this.http.patch<NoticeOfIntentDecisionConditionTypeDto>(`${this.url}/${code}`, updateDto),
);

if (updatedDecisionConditionType) {
this.toastService.showSuccessToast('Condition type updated successfully');
}

return updatedDecisionConditionType;
} catch (e) {
this.toastService.showErrorToast('Failed to update decision condition type');
console.error(e);
Expand Down

0 comments on commit e04783f

Please sign in to comment.