Fixes: 1) Refactor `useProducts` and `useCategorybySlug` composables for improved error handling and lazy loading; 2) Correct import path in `product-page.vue` for `useProductBySlug`; 3) Update `useLanguages` composable to set current locale from local storage; 4) Remove unused `auth.js`, `base-header.vue`, and deprecated GraphQL fragments; Extra: Minor styling adjustments and removal of redundant console logs; Updated `package-lock.json` dependencies for version consistency.
21 lines
438 B
JavaScript
21 lines
438 B
JavaScript
import { defineStore } from 'pinia'
|
|
import { ref } from 'vue'
|
|
|
|
export const useLanguageStore = defineStore('language', () => {
|
|
const languages = ref([]);
|
|
const setLanguages = (payload) => {
|
|
languages.value = payload
|
|
};
|
|
|
|
const currentLocale = ref(null);
|
|
const setCurrentLocale = (payload) => {
|
|
currentLocale.value = payload
|
|
};
|
|
|
|
return {
|
|
languages,
|
|
setLanguages,
|
|
currentLocale,
|
|
setCurrentLocale
|
|
}
|
|
})
|