Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix: #254 display messages from the backend using a toast
  • Loading branch information
enriquezrene committed May 19, 2020
commit 7c817abbc613c3fab3c01fceac2026e10c0bc350
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class ActivityEffects {
return new actions.LoadActivitiesSuccess(activities);
}),
catchError((error) => {
this.toastrService.error(error);
this.toastrService.error(error.error.message);
return of(new actions.LoadActivitiesFail(error));
})
)
Expand All @@ -45,7 +45,7 @@ export class ActivityEffects {
return new actions.CreateActivitySuccess(activityData);
}),
catchError((error) => {
this.toastrService.error(error);
this.toastrService.error(error.error.message);
return of(new actions.CreateActivityFail(error));
})
)
Expand All @@ -63,7 +63,7 @@ export class ActivityEffects {
return new actions.DeleteActivitySuccess(activityId);
}),
catchError((error) => {
this.toastrService.error(error);
this.toastrService.error(error.error.message);
return of(new actions.DeleteActivityFail(error));
})
)
Expand All @@ -81,7 +81,7 @@ export class ActivityEffects {
return new actions.UpdateActivitySuccess(activityData);
}),
catchError((error) => {
this.toastrService.error(error);
this.toastrService.error(error.error.message);
return of(new actions.UpdateActivityFail(error));
})
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class ProjectTypeEffects {
return new actions.LoadProjectTypesSuccess(projectTypes);
}),
catchError((error) => {
this.toastrService.error(error);
this.toastrService.error(error.error.message);
return of(new actions.LoadProjectTypesFail(error));
})
)
Expand All @@ -45,7 +45,7 @@ export class ProjectTypeEffects {
return new actions.CreateProjectTypeSuccess(projectTypeData);
}),
catchError((error) => {
this.toastrService.error(error);
this.toastrService.error(error.error.message);
return of(new actions.CreateProjectTypeFail(error));
})
)
Expand All @@ -63,7 +63,7 @@ export class ProjectTypeEffects {
return new actions.DeleteProjectTypeSuccess(protectTypeId);
}),
catchError((error) => {
this.toastrService.error(error);
this.toastrService.error(error.error.message);
return of(new actions.DeleteProjectTypeFail(error));
})
)
Expand All @@ -81,7 +81,7 @@ export class ProjectTypeEffects {
return new actions.UpdateProjectTypeSuccess(projectTypeData);
}),
catchError((error) => {
this.toastrService.error(error);
this.toastrService.error(error.error.message);
return of(new actions.UpdateProjectTypeFail(error));
})
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class ProjectEffects {
return new actions.LoadProjectsSuccess(projects);
}),
catchError((error) => {
this.toastrService.error(error);
this.toastrService.error(error.error.message);
return of(new actions.LoadProjectsFail(error));
})
)
Expand All @@ -41,7 +41,7 @@ export class ProjectEffects {
return new actions.LoadCustomerProjectsSuccess(project);
}),
catchError((error) => {
this.toastrService.error(error);
this.toastrService.error(error.error.message);
return of(new actions.LoadCustomerProjectsFail(error));
})
)
Expand All @@ -59,7 +59,7 @@ export class ProjectEffects {
return new actions.CreateProjectSuccess(projectData);
}),
catchError((error) => {
this.toastrService.error(error);
this.toastrService.error(error.error.message);
return of(new actions.CreateProjectFail(error));
})
)
Expand All @@ -77,7 +77,7 @@ export class ProjectEffects {
return new actions.UpdateProjectSuccess(projectData);
}),
catchError((error) => {
this.toastrService.error(error);
this.toastrService.error(error.error.message);
return of(new actions.UpdateProjectFail(error));
})
)
Expand All @@ -95,7 +95,7 @@ export class ProjectEffects {
return new actions.DeleteProjectSuccess(projectId);
}),
catchError((error) => {
this.toastrService.error(error);
this.toastrService.error(error.error.message);
return of(new actions.DeleteProjectFail(error));
})
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class CustomerEffects {
return new actions.LoadCustomersSuccess(customers);
}),
catchError((error) => {
this.toastrService.error(error);
this.toastrService.error(error.error.message);
return of(new actions.LoadCustomersFail(error));
}
)
Expand All @@ -45,7 +45,7 @@ export class CustomerEffects {
return new actions.CreateCustomerSuccess(customerData);
}),
catchError((error) => {
this.toastrService.error(error);
this.toastrService.error(error.error.message);
return of(new actions.CreateCustomerFail(error));
})
)
Expand All @@ -63,7 +63,7 @@ export class CustomerEffects {
return new actions.DeleteCustomerSuccesss(customerId);
}),
catchError((error) => {
this.toastrService.error(error);
this.toastrService.error(error.error.message);
return of(new actions.DeleteCustomerFail(error));
})
)
Expand All @@ -81,7 +81,7 @@ export class CustomerEffects {
return new actions.UpdateCustomerSuccess(customerData);
}),
catchError((error) => {
this.toastrService.error(error);
this.toastrService.error(error.error.message);
return of(new actions.UpdateCustomerFail(error));
})
)
Expand Down
2 changes: 1 addition & 1 deletion src/app/modules/shared/store/technology.effects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class TechnologyEffects {
return new actions.FindTechnologySuccess(technology);
}),
catchError((error) => {
this.toastrService.error(error);
this.toastrService.error(error.error.message);
return of(new actions.FindTechnologyFail(error));
})
)
Expand Down
8 changes: 4 additions & 4 deletions src/app/modules/time-clock/store/entry.effects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export class EntryEffects {
return new actions.CreateEntrySuccess(entryData);
}),
catchError((error) => {
this.toastrService.error(error);
this.toastrService.error(error.error.message);
return of(new actions.CreateEntryFail(error.error.message));
})
)
Expand All @@ -91,7 +91,7 @@ export class EntryEffects {
return new actions.DeleteEntrySuccess(entryId);
}),
catchError((error) => {
this.toastrService.error(error);
this.toastrService.error(error.error.message);
return of(new actions.DeleteEntryFail(error));
})
)
Expand All @@ -108,7 +108,7 @@ export class EntryEffects {
return new actions.UpdateActiveEntrySuccess(projectData);
}),
catchError((error) => {
this.toastrService.error(error);
this.toastrService.error(error.error.message);
return of(new actions.UpdateActiveEntryFail(error));
})
)
Expand All @@ -126,7 +126,7 @@ export class EntryEffects {
return new actions.StopTimeEntryRunningSuccess(timeEntryId);
}),
catchError((error) => {
this.toastrService.error(error);
this.toastrService.error(error.error.message);
return of(new actions.StopTimeEntryRunningFail(error.error.message));
})
)
Expand Down