migrate to gtea from bistbucket
This commit is contained in:
20
public/assets/plugins/custom/notification.js
Normal file
20
public/assets/plugins/custom/notification.js
Normal file
@@ -0,0 +1,20 @@
|
||||
function Notify(type, res, msg = null) {
|
||||
var type;
|
||||
var message;
|
||||
|
||||
switch (type) {
|
||||
case "error":
|
||||
message = msg ?? res.responseJSON.message ?? res.responseText ?? 'Oops! Something went wrong';
|
||||
toastr.error(message);
|
||||
break;
|
||||
case "success":
|
||||
message = msg ?? res.message ?? 'Congratulate! Operation Successful.';
|
||||
toastr.success(message);
|
||||
break;
|
||||
case "warning":
|
||||
message = msg ?? res.message ?? res.responseJSON.message ?? 'Warning! Operation Failed.';
|
||||
toastr.warning(message);
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user