mirror of
https://github.com/crater-invoice/crater.git
synced 2026-02-07 11:11:43 -05:00
Add New SweetAlert & Notification Components
This commit is contained in:
committed by
Mohit Panjwani
parent
3f7db2793f
commit
c3d3e5e35f
@@ -13,7 +13,6 @@ export const login = ({ commit }, data) => {
|
||||
commit('user/' + userTypes.RESET_CURRENT_USER, null, { root: true })
|
||||
commit(rootTypes.UPDATE_APP_LOADING_STATUS, false, { root: true })
|
||||
|
||||
window.toastr['success']('Login Successful')
|
||||
resolve(response)
|
||||
})
|
||||
.catch((err) => {
|
||||
@@ -28,7 +27,7 @@ export const setLogoutFalse = ({ state, commit }) => {
|
||||
commit(types.SET_LOGOUT, false)
|
||||
}
|
||||
|
||||
export const logout = ({ state, commit }) => {
|
||||
export const logout = ({ state, commit, dispatch }) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (state.isLoggedOut) {
|
||||
resolve()
|
||||
@@ -40,7 +39,14 @@ export const logout = ({ state, commit }) => {
|
||||
.get('/auth/logout')
|
||||
.then(() => {
|
||||
router.push('/login')
|
||||
window.toastr['success']('Logged out!', 'Success')
|
||||
dispatch(
|
||||
'notification/showNotification',
|
||||
{
|
||||
type: 'success',
|
||||
message: 'Logged out successfully.',
|
||||
},
|
||||
{ root: true }
|
||||
)
|
||||
})
|
||||
.catch((err) => {
|
||||
router.push('/login')
|
||||
|
||||
Reference in New Issue
Block a user