feat(edit): 编辑页类目树逻辑开发
This commit is contained in:
@@ -39,30 +39,19 @@ export const productEditorApi = {
|
||||
'If-Match': `"${revisions.product}:${revisions.profile}"`,
|
||||
},
|
||||
}),
|
||||
categoryOptions: (profileId: string, platformId: string, search?: string) =>
|
||||
categoryOptions: (profileId: string, platformId: string, search?: string, storeId?: string | null) =>
|
||||
api.get<ProductEditorCategoryOption[]>(
|
||||
`/product-platform-profiles/${profileId}/category-options`,
|
||||
{
|
||||
params: search ? { q: search } : undefined,
|
||||
params: { ...(search ? { q: search } : {}), ...(storeId ? { store_id: storeId } : {}) },
|
||||
headers: { 'X-Atlas-Platform-Id': platformId },
|
||||
}
|
||||
),
|
||||
syncCategoryTree: (profileId: string, platformId: string) =>
|
||||
api.post<{ operation: Operation }>(
|
||||
`/product-platform-profiles/${profileId}/category-syncs`,
|
||||
undefined,
|
||||
{
|
||||
headers: {
|
||||
'X-Atlas-Platform-Id': platformId,
|
||||
'Idempotency-Key': crypto.randomUUID(),
|
||||
},
|
||||
}
|
||||
),
|
||||
attributeSchema: (profileId: string, platformId: string, categoryId?: string | null) =>
|
||||
attributeSchema: (profileId: string, platformId: string, categoryId?: string | null, storeId?: string | null) =>
|
||||
api.get<ProductAttributeSchema[]>(
|
||||
`/product-platform-profiles/${profileId}/attribute-schema`,
|
||||
{
|
||||
params: categoryId ? { category_id: categoryId } : undefined,
|
||||
params: { ...(categoryId ? { category_id: categoryId } : {}), ...(storeId ? { store_id: storeId } : {}) },
|
||||
headers: { 'X-Atlas-Platform-Id': platformId },
|
||||
}
|
||||
),
|
||||
@@ -83,13 +72,15 @@ export const productEditorApi = {
|
||||
platformId: string,
|
||||
dictionaryId: string,
|
||||
search?: string,
|
||||
categoryId?: string | null
|
||||
categoryId?: string | null,
|
||||
storeId?: string | null,
|
||||
) =>
|
||||
api.get<{ items: ProductAttributeDictionaryValue[]; next_cursor: string | null }>(
|
||||
`/product-platform-profiles/${profileId}/attribute-dictionaries/${encodeURIComponent(dictionaryId)}`,
|
||||
{
|
||||
params: {
|
||||
...(categoryId ? { category_id: categoryId } : {}),
|
||||
...(storeId ? { store_id: storeId } : {}),
|
||||
...(search ? { q: search } : {}),
|
||||
},
|
||||
headers: { 'X-Atlas-Platform-Id': platformId },
|
||||
|
||||
Reference in New Issue
Block a user