fix: nama_regu -> nama_petugas in pencarianData
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { ref, computed } from 'vue'
|
||||
import { defineStore } from 'pinia'
|
||||
import { dispatchNotification } from '@/components/Notification'
|
||||
import { readData, removeData, writeData } from '@/utils/storage'
|
||||
import { readData, removeData, writeData, writeDataJson } from '@/utils/storage'
|
||||
import router from '@/router'
|
||||
|
||||
export const useAuthStore = defineStore('auth', () => {
|
||||
@@ -12,6 +12,12 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
const password = ref('')
|
||||
const isLoading = ref(false)
|
||||
const isLoggedIn = computed(() => token.value !== '')
|
||||
const filterPresets = {
|
||||
uid: {
|
||||
id: 2,
|
||||
name: 'DISTRIBUSI JAKARTA RAYA'
|
||||
}
|
||||
}
|
||||
|
||||
// define your actions
|
||||
const login = () => {
|
||||
@@ -28,6 +34,8 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
if (username.value == 'demo' && password.value == 'demo') {
|
||||
// store token in localStorage
|
||||
writeData('token', 'secret-token')
|
||||
writeDataJson('filterPresets', filterPresets)
|
||||
|
||||
dispatchNotification({
|
||||
title: 'Berhasil',
|
||||
content: 'Login berhasil, selamat datang kembali!',
|
||||
@@ -46,7 +54,10 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
}
|
||||
}
|
||||
|
||||
const logout = () => removeData('token')
|
||||
const logout = () => {
|
||||
removeData('token')
|
||||
removeData('filterPresets')
|
||||
}
|
||||
|
||||
return {
|
||||
token,
|
||||
|
Reference in New Issue
Block a user