Skip to content

Commit

Permalink
Update helper.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
aelassas committed Apr 3, 2024
1 parent f70a601 commit 09dcb5d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions backend/src/common/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const getLanguage = (code: string) => env._LANGUAGES.find((l) => l.code =
* @param {string} message
*/
export const info = (message: string) => {
toast(message, { type: 'info' })
toast.info(message)
}

/**
Expand All @@ -35,9 +35,9 @@ export const error = (err?: unknown, message?: string) => {
console.error(err)
}
if (message) {
toast(message, { type: 'error' })
toast.error(message)
} else {
toast(commonStrings.GENERIC_ERROR, { type: 'error' })
toast.error(commonStrings.GENERIC_ERROR)
}
}

Expand Down
6 changes: 3 additions & 3 deletions frontend/src/common/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const getLanguage = (code: string) => env._LANGUAGES.find((l) => l.code =
* @param {string} message
*/
export const info = (message: string) => {
toast(message, { type: 'info' })
toast.info(message)
}

/**
Expand All @@ -34,9 +34,9 @@ export const error = (err?: unknown, message?: string) => {
console.error(err)
}
if (message) {
toast(message, { type: 'error' })
toast.error(message)
} else {
toast(commonStrings.GENERIC_ERROR, { type: 'error' })
toast.error(commonStrings.GENERIC_ERROR)
}
}

Expand Down

0 comments on commit 09dcb5d

Please sign in to comment.