feat: add product select to price alerts

Customer can pick a product when creating an alert and see it on the card.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-18 22:23:25 +03:30
co-authored by Cursor
parent e01192fb5e
commit e578ba521d
8 changed files with 66 additions and 71 deletions
+9 -13
View File
@@ -1,7 +1,6 @@
import { computed, ref } from 'vue'
import { defineStore } from 'pinia'
import { getSettings } from '@/api/configuration'
import { fetchSuperAdminProgramSettings, isLockedCanEdit } from '@/api/superadminSettings'
import { resolveMeltedGoldLabel, resolveMetalTypeLabel } from '@/utils/metalLabels'
import { resolveTradeWeightUnit } from '@/utils/weightUnit'
@@ -13,7 +12,6 @@ export interface AppSetting {
description?: string
is_active?: boolean
type?: string
can_edit?: number | boolean | string
}
export const useSettingsStore = defineStore('settings', () => {
@@ -67,19 +65,17 @@ export const useSettingsStore = defineStore('settings', () => {
fetchPromise = (async () => {
try {
const localRaw = await getSettings().catch(() => [])
const remote = await fetchSuperAdminProgramSettings()
const local = Array.isArray(localRaw) ? localRaw : []
const editable = local.filter((row) => !isLockedCanEdit(row?.can_edit))
settings.value = []
mergeSettings(remote as AppSetting[])
mergeSettings(editable)
loaded.value = true
return settings.value
const data = await getSettings()
if (Array.isArray(data)) {
mergeSettings(data)
}
} catch (error) {
fetchPromise = null
throw error
console.log(error)
} finally {
loaded.value = true
}
return settings.value
})()
return fetchPromise