mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-04-07 13:41:23 +00:00
Upgrade Pinia from v2 to v3 (#596)
Migrate all 37 store definitions from the deprecated object-with-id
signature to the string-id-first signature required by Pinia 3:
defineStore({ id: 'name', ... }) → defineStore('name', { ... })
This commit is contained in:
committed by
GitHub
parent
ad5a7e51b9
commit
3ceb08bc31
3
resources/scripts/customer/stores/auth.js
vendored
3
resources/scripts/customer/stores/auth.js
vendored
@@ -5,8 +5,7 @@ import router from '@/scripts/customer/customer-router'
|
||||
import { handleError } from '@/scripts/customer/helpers/error-handling'
|
||||
const { global } = window.i18n
|
||||
|
||||
export const useAuthStore = defineStore({
|
||||
id: 'customerAuth',
|
||||
export const useAuthStore = defineStore('customerAuth', {
|
||||
state: () => ({
|
||||
loginData: {
|
||||
email: '',
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
const { defineStore } = window.pinia
|
||||
|
||||
export const useCustomerStore = defineStore({
|
||||
id: 'customers',
|
||||
export const useCustomerStore = defineStore('customers', {
|
||||
state: () => ({
|
||||
customers: 'okay',
|
||||
}),
|
||||
|
||||
@@ -3,8 +3,7 @@ import { useGlobalStore } from '@/scripts/customer/stores/global'
|
||||
import http from '@/scripts/http'
|
||||
import { handleError } from '@/scripts/customer/helpers/error-handling'
|
||||
|
||||
export const useDashboardStore = defineStore({
|
||||
id: 'dashboard',
|
||||
export const useDashboardStore = defineStore('dashboard', {
|
||||
state: () => ({
|
||||
recentInvoices: [],
|
||||
recentEstimates: [],
|
||||
|
||||
@@ -3,8 +3,7 @@ import { useNotificationStore } from '@/scripts/stores/notification'
|
||||
import http from '@/scripts/http'
|
||||
import { handleError } from '@/scripts/customer/helpers/error-handling'
|
||||
|
||||
export const useEstimateStore = defineStore({
|
||||
id: 'customerEstimateStore',
|
||||
export const useEstimateStore = defineStore('customerEstimateStore', {
|
||||
state: () => ({
|
||||
estimates: [],
|
||||
totalEstimates: 0,
|
||||
|
||||
3
resources/scripts/customer/stores/global.js
vendored
3
resources/scripts/customer/stores/global.js
vendored
@@ -3,8 +3,7 @@ import { useUserStore } from './user'
|
||||
const { defineStore } = window.pinia
|
||||
import http from '@/scripts/http'
|
||||
const { global } = window.i18n
|
||||
export const useGlobalStore = defineStore({
|
||||
id: 'CustomerPortalGlobalStore',
|
||||
export const useGlobalStore = defineStore('CustomerPortalGlobalStore', {
|
||||
state: () => ({
|
||||
languages: [],
|
||||
currency: null,
|
||||
|
||||
3
resources/scripts/customer/stores/invoice.js
vendored
3
resources/scripts/customer/stores/invoice.js
vendored
@@ -1,8 +1,7 @@
|
||||
import { handleError } from '@/scripts/customer/helpers/error-handling'
|
||||
const { defineStore } = window.pinia
|
||||
import http from '@/scripts/http'
|
||||
export const useInvoiceStore = defineStore({
|
||||
id: 'customerInvoiceStore',
|
||||
export const useInvoiceStore = defineStore('customerInvoiceStore', {
|
||||
state: () => ({
|
||||
totalInvoices: 0,
|
||||
invoices: [],
|
||||
|
||||
3
resources/scripts/customer/stores/payment.js
vendored
3
resources/scripts/customer/stores/payment.js
vendored
@@ -2,8 +2,7 @@ import { handleError } from '@/scripts/customer/helpers/error-handling'
|
||||
const { defineStore } = window.pinia
|
||||
import http from '@/scripts/http'
|
||||
|
||||
export const usePaymentStore = defineStore({
|
||||
id: 'customerPaymentStore',
|
||||
export const usePaymentStore = defineStore('customerPaymentStore', {
|
||||
state: () => ({
|
||||
payments: [],
|
||||
selectedViewPayment: [],
|
||||
|
||||
4
resources/scripts/customer/stores/user.js
vendored
4
resources/scripts/customer/stores/user.js
vendored
@@ -5,9 +5,7 @@ import stubs from '@/scripts/customer/stubs/address'
|
||||
import http from '@/scripts/http'
|
||||
import { useGlobalStore } from '@/scripts/customer/stores/global'
|
||||
|
||||
export const useUserStore = defineStore({
|
||||
id: 'customerUserStore',
|
||||
|
||||
export const useUserStore = defineStore('customerUserStore', {
|
||||
state: () => ({
|
||||
customers: [],
|
||||
userForm: {
|
||||
|
||||
Reference in New Issue
Block a user