dont show deleted catalogues
This commit is contained in:
@@ -68,7 +68,10 @@ export class CatalogueService {
|
||||
}
|
||||
|
||||
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) {
|
||||
throw new NotFoundException("catalogue by slug not found")
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ export class CatalogueRepository extends EntityRepository<Catalogue> {
|
||||
|
||||
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, {
|
||||
limit,
|
||||
|
||||
Reference in New Issue
Block a user