Save catalog delivery addresses and reuse them on the next request.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import { computed, ref } from 'vue'
|
||||
import { apiRequest } from '@/services/http'
|
||||
import { ApiError, apiRequest } from '@/services/http'
|
||||
|
||||
const STORAGE_KEY = 'ft_catalog_requests'
|
||||
|
||||
@@ -182,8 +182,10 @@ export const useCatalogRequestsStore = defineStore('catalogRequests', () => {
|
||||
writeAll(requests.value)
|
||||
return { success: true as const, request: mapped }
|
||||
} catch (err) {
|
||||
if (err instanceof ApiError && err.status >= 400 && err.status < 500) {
|
||||
return { success: false as const, message: err.message }
|
||||
}
|
||||
useApi.value = false
|
||||
// fall through to local
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user