refactor: 产品页与产品列表的API重构
- 将产品页与产品列表的API由REST重构为GraphQL - 修改Mapper与单元测试
This commit is contained in:
@ -37,7 +37,7 @@
|
||||
const localePath = useLocalePath();
|
||||
const { getImageUrl } = useDirectusImage();
|
||||
|
||||
const { data, pending, error } = useProductList();
|
||||
const { data, pending, error } = await useProductList();
|
||||
|
||||
const activeNames = ref<string[]>([]);
|
||||
|
||||
@ -46,12 +46,13 @@
|
||||
{ label: $t('navigation.products') },
|
||||
];
|
||||
|
||||
const productsRaw = computed(() => data.value ?? []);
|
||||
const productsRaw = computed(() => data.value.products ?? []);
|
||||
|
||||
const products = computed(() =>
|
||||
productsRaw.value.map((item) => toProductListView(item))
|
||||
);
|
||||
|
||||
logger.debug('products: ', products.value);
|
||||
logger.debug('产品列表数据: ', products.value);
|
||||
|
||||
// 按类型分组
|
||||
const groupedProducts = computed(() => {
|
||||
|
||||
Reference in New Issue
Block a user