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:
Darko Gjorgjijoski
2026-04-02 16:12:11 +02:00
committed by GitHub
parent ad5a7e51b9
commit 3ceb08bc31
39 changed files with 121 additions and 109 deletions

View File

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

View File

@@ -1,7 +1,6 @@
const { defineStore } = window.pinia
export const useCustomerStore = defineStore({
id: 'customers',
export const useCustomerStore = defineStore('customers', {
state: () => ({
customers: 'okay',
}),

View File

@@ -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: [],

View File

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

View File

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

View File

@@ -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: [],

View File

@@ -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: [],

View File

@@ -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: {