Skip to content

Commit

Permalink
Update object.repository.ts
Browse files Browse the repository at this point in the history
Fix mall object search to only show approved mall objects.
  • Loading branch information
SalleeMatthew authored and smile0711 committed Aug 28, 2024
1 parent 0263674 commit 3064ad5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions api/src/repositories/object/object.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ export class ObjectRepository {

public async searchMallObjects(search: string, limit: number, offset: number): Promise<any> {
return await this.db.object
.where('status','!=', '0')
.where('status','!=', '2')
.where(this.like('name', search))
.limit(limit)
.offset(offset);
Expand All @@ -106,6 +108,8 @@ export class ObjectRepository {
public async getTotal(search: string): Promise<any> {
return await this.db.object
.count('id as count')
.where('status','!=', '0')
.where('status','!=', '2')
.where(this.like('object.name', search));
}

Expand Down

0 comments on commit 3064ad5

Please sign in to comment.