feat: Add MarketTest page and enhance error handling in market components
- Introduce MarketTest.vue for testing market loading and state management. - Update error handling in Market.vue and useMarket composable to utilize marketStore for consistent error reporting. - Enhance logging throughout market loading processes for better debugging and user feedback.
This commit is contained in:
parent
1a3510becb
commit
1ed8759162
6 changed files with 144 additions and 10 deletions
|
|
@ -14,7 +14,7 @@ export interface Market {
|
|||
logo?: string
|
||||
banner?: string
|
||||
merchants: string[]
|
||||
ui: Record<string, any>
|
||||
ui?: Record<string, any>
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -87,6 +87,7 @@ export const useMarketStore = defineStore('market', () => {
|
|||
|
||||
// UI state
|
||||
const isLoading = ref(false)
|
||||
const error = ref<string | null>(null)
|
||||
const searchText = ref('')
|
||||
const showFilterDetails = ref(false)
|
||||
|
||||
|
|
@ -214,6 +215,10 @@ export const useMarketStore = defineStore('market', () => {
|
|||
const setLoading = (loading: boolean) => {
|
||||
isLoading.value = loading
|
||||
}
|
||||
|
||||
const setError = (errorMessage: string | null) => {
|
||||
error.value = errorMessage
|
||||
}
|
||||
|
||||
const setSearchText = (text: string) => {
|
||||
searchText.value = text
|
||||
|
|
@ -335,6 +340,7 @@ export const useMarketStore = defineStore('market', () => {
|
|||
activeStall: readonly(activeStall),
|
||||
activeProduct: readonly(activeProduct),
|
||||
isLoading: readonly(isLoading),
|
||||
error: readonly(error),
|
||||
searchText: readonly(searchText),
|
||||
showFilterDetails: readonly(showFilterDetails),
|
||||
filterData: readonly(filterData),
|
||||
|
|
@ -349,6 +355,7 @@ export const useMarketStore = defineStore('market', () => {
|
|||
|
||||
// Actions
|
||||
setLoading,
|
||||
setError,
|
||||
setSearchText,
|
||||
setActiveMarket,
|
||||
setActiveStall,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue