Prechádzať zdrojové kódy

fix(core): Return type of collection breadcrumb was missing slug (#2960)

Martijn 1 rok pred
rodič
commit
620eeb18e3

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

@@ -78,7 +78,7 @@ export class CollectionEntityResolver {
         @Ctx() ctx: RequestContext,
         @Parent() collection: Collection,
     ): Promise<CollectionBreadcrumb[]> {
-        return this.collectionService.getBreadcrumbs(ctx, collection) as any;
+        return this.collectionService.getBreadcrumbs(ctx, collection);
     }
 
     @ResolveField()

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

@@ -292,7 +292,7 @@ export class CollectionService implements OnModuleInit {
     async getBreadcrumbs(
         ctx: RequestContext,
         collection: Collection,
-    ): Promise<Array<{ name: string; id: ID }>> {
+    ): Promise<Array<{ name: string; id: ID, slug: string }>> {
         const rootCollection = await this.getRootCollection(ctx);
         if (idsAreEqual(collection.id, rootCollection.id)) {
             return [pick(rootCollection, ['id', 'name', 'slug'])];