feat(brand): add brand sort order and drag-to-reorder
Add a sort_order column to brands with a migration, expose a PUT /api/tenant/brands/order reorder endpoint, and wire the admin-web BrandsView with drag-and-drop reordering plus i18n. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -59,8 +59,7 @@ export const useCompanyStore = defineStore('company', () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const nextBrands = normalizeBrandList(await brandsApi.list())
|
||||
brands.value = nextBrands
|
||||
syncCurrentBrand(nextBrands)
|
||||
setBrands(nextBrands)
|
||||
initialized.value = true
|
||||
return nextBrands
|
||||
} finally {
|
||||
@@ -68,6 +67,12 @@ export const useCompanyStore = defineStore('company', () => {
|
||||
}
|
||||
}
|
||||
|
||||
function setBrands(value: Brand[] | null | undefined): void {
|
||||
const nextBrands = normalizeBrandList(value)
|
||||
brands.value = nextBrands
|
||||
syncCurrentBrand(nextBrands)
|
||||
}
|
||||
|
||||
function reset(): void {
|
||||
brands.value = []
|
||||
currentBrandId.value = null
|
||||
@@ -84,6 +89,7 @@ export const useCompanyStore = defineStore('company', () => {
|
||||
loading,
|
||||
initialized,
|
||||
refreshBrands,
|
||||
setBrands,
|
||||
setCurrentBrand,
|
||||
reset,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user