Browse Source

fix(core): Fix collection findBySlug issue (#2480)

Fixes #2395 

Co-authored-by: Gautier Darchen <darchen.gautier@gmail.com>
Thierry 2 years ago
parent
commit
894ace79f8
1 changed files with 8 additions and 1 deletions
  1. 8 1
      packages/core/src/service/services/collection.service.ts

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

@@ -223,7 +223,14 @@ export class CollectionService implements OnModuleInit {
     ): Promise<Translated<Collection> | undefined> {
         const translations = await this.connection.getRepository(ctx, CollectionTranslation).find({
             relations: ['base'],
-            where: { slug },
+            where: {
+                slug,
+                base: {
+                    channels: {
+                        id: ctx.channelId,
+                    },
+                },
+            },
         });
 
         if (!translations?.length) {