Skip to content

Commit 7c817ab

Browse files
committed
fix: #254 display messages from the backend using a toast
1 parent c810db3 commit 7c817ab

File tree

6 files changed

+22
-22
lines changed

6 files changed

+22
-22
lines changed

src/app/modules/activities-management/store/activity-management.effects.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export class ActivityEffects {
2727
return new actions.LoadActivitiesSuccess(activities);
2828
}),
2929
catchError((error) => {
30-
this.toastrService.error(error);
30+
this.toastrService.error(error.error.message);
3131
return of(new actions.LoadActivitiesFail(error));
3232
})
3333
)
@@ -45,7 +45,7 @@ export class ActivityEffects {
4545
return new actions.CreateActivitySuccess(activityData);
4646
}),
4747
catchError((error) => {
48-
this.toastrService.error(error);
48+
this.toastrService.error(error.error.message);
4949
return of(new actions.CreateActivityFail(error));
5050
})
5151
)
@@ -63,7 +63,7 @@ export class ActivityEffects {
6363
return new actions.DeleteActivitySuccess(activityId);
6464
}),
6565
catchError((error) => {
66-
this.toastrService.error(error);
66+
this.toastrService.error(error.error.message);
6767
return of(new actions.DeleteActivityFail(error));
6868
})
6969
)
@@ -81,7 +81,7 @@ export class ActivityEffects {
8181
return new actions.UpdateActivitySuccess(activityData);
8282
}),
8383
catchError((error) => {
84-
this.toastrService.error(error);
84+
this.toastrService.error(error.error.message);
8585
return of(new actions.UpdateActivityFail(error));
8686
})
8787
)

src/app/modules/customer-management/components/projects-type/store/project-type.effects.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export class ProjectTypeEffects {
2727
return new actions.LoadProjectTypesSuccess(projectTypes);
2828
}),
2929
catchError((error) => {
30-
this.toastrService.error(error);
30+
this.toastrService.error(error.error.message);
3131
return of(new actions.LoadProjectTypesFail(error));
3232
})
3333
)
@@ -45,7 +45,7 @@ export class ProjectTypeEffects {
4545
return new actions.CreateProjectTypeSuccess(projectTypeData);
4646
}),
4747
catchError((error) => {
48-
this.toastrService.error(error);
48+
this.toastrService.error(error.error.message);
4949
return of(new actions.CreateProjectTypeFail(error));
5050
})
5151
)
@@ -63,7 +63,7 @@ export class ProjectTypeEffects {
6363
return new actions.DeleteProjectTypeSuccess(protectTypeId);
6464
}),
6565
catchError((error) => {
66-
this.toastrService.error(error);
66+
this.toastrService.error(error.error.message);
6767
return of(new actions.DeleteProjectTypeFail(error));
6868
})
6969
)
@@ -81,7 +81,7 @@ export class ProjectTypeEffects {
8181
return new actions.UpdateProjectTypeSuccess(projectTypeData);
8282
}),
8383
catchError((error) => {
84-
this.toastrService.error(error);
84+
this.toastrService.error(error.error.message);
8585
return of(new actions.UpdateProjectTypeFail(error));
8686
})
8787
)

src/app/modules/customer-management/components/projects/components/store/project.effects.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export class ProjectEffects {
2525
return new actions.LoadProjectsSuccess(projects);
2626
}),
2727
catchError((error) => {
28-
this.toastrService.error(error);
28+
this.toastrService.error(error.error.message);
2929
return of(new actions.LoadProjectsFail(error));
3030
})
3131
)
@@ -41,7 +41,7 @@ export class ProjectEffects {
4141
return new actions.LoadCustomerProjectsSuccess(project);
4242
}),
4343
catchError((error) => {
44-
this.toastrService.error(error);
44+
this.toastrService.error(error.error.message);
4545
return of(new actions.LoadCustomerProjectsFail(error));
4646
})
4747
)
@@ -59,7 +59,7 @@ export class ProjectEffects {
5959
return new actions.CreateProjectSuccess(projectData);
6060
}),
6161
catchError((error) => {
62-
this.toastrService.error(error);
62+
this.toastrService.error(error.error.message);
6363
return of(new actions.CreateProjectFail(error));
6464
})
6565
)
@@ -77,7 +77,7 @@ export class ProjectEffects {
7777
return new actions.UpdateProjectSuccess(projectData);
7878
}),
7979
catchError((error) => {
80-
this.toastrService.error(error);
80+
this.toastrService.error(error.error.message);
8181
return of(new actions.UpdateProjectFail(error));
8282
})
8383
)
@@ -95,7 +95,7 @@ export class ProjectEffects {
9595
return new actions.DeleteProjectSuccess(projectId);
9696
}),
9797
catchError((error) => {
98-
this.toastrService.error(error);
98+
this.toastrService.error(error.error.message);
9999
return of(new actions.DeleteProjectFail(error));
100100
})
101101
)

src/app/modules/customer-management/store/customer-management.effects.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export class CustomerEffects {
2626
return new actions.LoadCustomersSuccess(customers);
2727
}),
2828
catchError((error) => {
29-
this.toastrService.error(error);
29+
this.toastrService.error(error.error.message);
3030
return of(new actions.LoadCustomersFail(error));
3131
}
3232
)
@@ -45,7 +45,7 @@ export class CustomerEffects {
4545
return new actions.CreateCustomerSuccess(customerData);
4646
}),
4747
catchError((error) => {
48-
this.toastrService.error(error);
48+
this.toastrService.error(error.error.message);
4949
return of(new actions.CreateCustomerFail(error));
5050
})
5151
)
@@ -63,7 +63,7 @@ export class CustomerEffects {
6363
return new actions.DeleteCustomerSuccesss(customerId);
6464
}),
6565
catchError((error) => {
66-
this.toastrService.error(error);
66+
this.toastrService.error(error.error.message);
6767
return of(new actions.DeleteCustomerFail(error));
6868
})
6969
)
@@ -81,7 +81,7 @@ export class CustomerEffects {
8181
return new actions.UpdateCustomerSuccess(customerData);
8282
}),
8383
catchError((error) => {
84-
this.toastrService.error(error);
84+
this.toastrService.error(error.error.message);
8585
return of(new actions.UpdateCustomerFail(error));
8686
})
8787
)

src/app/modules/shared/store/technology.effects.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export class TechnologyEffects {
2222
return new actions.FindTechnologySuccess(technology);
2323
}),
2424
catchError((error) => {
25-
this.toastrService.error(error);
25+
this.toastrService.error(error.error.message);
2626
return of(new actions.FindTechnologyFail(error));
2727
})
2828
)

src/app/modules/time-clock/store/entry.effects.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export class EntryEffects {
7373
return new actions.CreateEntrySuccess(entryData);
7474
}),
7575
catchError((error) => {
76-
this.toastrService.error(error);
76+
this.toastrService.error(error.error.message);
7777
return of(new actions.CreateEntryFail(error.error.message));
7878
})
7979
)
@@ -91,7 +91,7 @@ export class EntryEffects {
9191
return new actions.DeleteEntrySuccess(entryId);
9292
}),
9393
catchError((error) => {
94-
this.toastrService.error(error);
94+
this.toastrService.error(error.error.message);
9595
return of(new actions.DeleteEntryFail(error));
9696
})
9797
)
@@ -108,7 +108,7 @@ export class EntryEffects {
108108
return new actions.UpdateActiveEntrySuccess(projectData);
109109
}),
110110
catchError((error) => {
111-
this.toastrService.error(error);
111+
this.toastrService.error(error.error.message);
112112
return of(new actions.UpdateActiveEntryFail(error));
113113
})
114114
)
@@ -126,7 +126,7 @@ export class EntryEffects {
126126
return new actions.StopTimeEntryRunningSuccess(timeEntryId);
127127
}),
128128
catchError((error) => {
129-
this.toastrService.error(error);
129+
this.toastrService.error(error.error.message);
130130
return of(new actions.StopTimeEntryRunningFail(error.error.message));
131131
})
132132
)

0 commit comments

Comments
 (0)