Skip to content

Commit

Permalink
add new helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
seiyria committed Sep 20, 2023
1 parent 35b09b5 commit 5b7ae07
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions server/src/utils/usernotifications.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { UserResponse } from '@interfaces';

export function userNotify(message: string, type: string): UserResponse {
return {
actions: [
{
type: 'Notify',
messageType: type,
message,
},
],
};
}

export function userError(message: string): UserResponse {
return this.userNotify(message, 'error');
}

export function userSuccess(message: string): UserResponse {
return this.userNotify(message, 'success');
}

0 comments on commit 5b7ae07

Please sign in to comment.