WIP jordan
This commit is contained in:
18
app/composables/useCustomerProfileVault.ts
Normal file
18
app/composables/useCustomerProfileVault.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { emptyCustomerProfile, type CustomerProfileVault } from '~/types/customer-profile'
|
||||
import { useLocalStorageRef } from '~/utils/useLocalStorageRef'
|
||||
|
||||
const KEY = 'policy-ui-customer-profile-vault-v1'
|
||||
|
||||
export function useCustomerProfileVault() {
|
||||
const profile = useLocalStorageRef(KEY, () => emptyCustomerProfile())
|
||||
|
||||
function touch() {
|
||||
profile.value.updatedAt = new Date().toISOString()
|
||||
}
|
||||
|
||||
function reset() {
|
||||
profile.value = emptyCustomerProfile()
|
||||
}
|
||||
|
||||
return { profile, touch, reset }
|
||||
}
|
||||
Reference in New Issue
Block a user