fix: nama_regu -> nama_petugas in pencarianData

This commit is contained in:
kur0nek-o
2024-04-24 12:34:52 +07:00
parent 7a70812b2e
commit 581801e098
3 changed files with 18 additions and 4 deletions

View File

@@ -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,