source: WineTrackerFinal/WineTrackerUI/WineTracker/src/assets/ErrorHandler.ts@ 04008ae

main
Last change on this file since 04008ae was 04008ae, checked in by Nikola Mishevski <Nikola.Mishevski@…>, 6 days ago

WineTracker UI Added to Git

  • Property mode set to 100644
File size: 618 bytes
RevLine 
[04008ae]1import { ToastrService } from "ngx-toastr";
2import { ErrorHandlerModel } from "src/app/models";
3
4export function ShowErrorToaster(toastr: ToastrService, response: any){
5 let error: ErrorHandlerModel = response.error
6 if(error.name != undefined) toastr.error(error.description, error.name, {positionClass: 'toast-bottom-right'})
7 else toastr.error(response.error, "An error occured with the action.", {positionClass: 'toast-bottom-right'})
8}
9
10export function ShowSuccessToaster(toastr: ToastrService){
11 toastr.success("Action was completed successfully.", "Success", {positionClass: 'toast-bottom-right'})
12}
Note: See TracBrowser for help on using the repository browser.