فهرست منبع

fix(dashboard): Use localecompare instead of .sort

Will Nahmens 2 هفته پیش
والد
کامیت
23f77e4dcc

+ 1 - 2
packages/core/src/api/resolvers/entity/collection-entity.resolver.ts

@@ -65,8 +65,7 @@ export class CollectionEntityResolver {
         const onlyTotalItems = this.isOnlyTotalItemsRequested(info);
 
         if (onlyTotalItems) {
-            // On top level (e.g. viewing collections) only retrieve count
-            Logger.log(`Only retrieving total items for collection ${collection.id}`);
+            // e.g. viewing collections only retrieve count for display purposes
             const totalItems = await this.productVariantService.getVariantCountByCollectionId(
                 ctx,
                 collection.id,

+ 1 - 0
packages/core/src/service/services/collection.service.ts

@@ -405,6 +405,7 @@ export class CollectionService implements OnModuleInit {
         ctx?: RequestContext,
     ): Promise<Array<Translated<Collection> | Collection>> {
         // Use PostgreSQL recursive CTE to fetch all ancestors in a single query
+        Logger.verbose(`[OPTIMIZED CTE] Getting ancestors for collection ${collectionId}`);
         const query = `
             WITH RECURSIVE collection_ancestors AS (
                 -- Base case: get the immediate parent (depth 1)

+ 1 - 1
packages/dashboard/src/app/routes/_authenticated/_collections/collections.tsx

@@ -52,7 +52,7 @@ function CollectionListPage() {
         .map(([id, _]) => id);
 
     const { data: childCollectionsData } = useQuery({
-        queryKey: ['childCollections', ...expandedIds.sort()],
+        queryKey: ['childCollections', ...expandedIds.sort((a, b) => a.localeCompare(b))],
         queryFn: () =>
             api.query(collectionListDocument, {
                 options: {

+ 1 - 1
packages/dev-server/dev-config.ts

@@ -56,7 +56,7 @@ export const devConfig: VendureConfig = {
     },
     dbConnectionOptions: {
         synchronize: false,
-        logging: false,
+        logging: true, // Enable all logging
         migrations: [path.join(__dirname, 'migrations/*.ts')],
         ...getDbConfig(),
     },