dont show deleted catalogues

This commit is contained in:
2026-06-07 15:57:24 +03:30
parent 4aba85ab4e
commit 526ced0101
2 changed files with 5 additions and 2 deletions
+4 -1
View File
@@ -68,7 +68,10 @@ export class CatalogueService {
} }
async findOneOrFailBySlug(businessSlug: string, catalogueSlug: string) { async findOneOrFailBySlug(businessSlug: string, catalogueSlug: string) {
const catalogue = await this.catalogueRepository.findOne({ business: { slug: businessSlug }, slug: catalogueSlug }) const catalogue = await this.catalogueRepository.findOne(
{ business: { slug: businessSlug }, slug: catalogueSlug },
{ filters: { notDeleted: true } },
)
if (!catalogue) { if (!catalogue) {
throw new NotFoundException("catalogue by slug not found") throw new NotFoundException("catalogue by slug not found")
} }
@@ -9,7 +9,7 @@ export class CatalogueRepository extends EntityRepository<Catalogue> {
const offset = (page - 1) * limit; const offset = (page - 1) * limit;
const where: FilterQuery<Catalogue> = { business: { slug } }; const where: FilterQuery<Catalogue> = { business: { slug }, deletedAt: null };
const [data, total] = await this.findAndCount(where, { const [data, total] = await this.findAndCount(where, {
limit, limit,