cleanup + Property images
This commit is contained in:
@@ -51,8 +51,11 @@ export class UserService {
|
||||
const start = criteria.start ? criteria.start : 0;
|
||||
const length = criteria.length ? criteria.length : 12;
|
||||
const conditions = this.getConditions(criteria)
|
||||
const users = await this.conn.select().from(schema.users).where(and(...conditions)).offset(start).limit(length)
|
||||
return users
|
||||
const [data, total] = await Promise.all([
|
||||
this.conn.select().from(schema.users).where(and(...conditions)).offset(start).limit(length),
|
||||
this.conn.select({ count: sql`count(*)` }).from(schema.users).where(and(...conditions)).then((result) => Number(result[0].count)),
|
||||
]);
|
||||
return { total, data };
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user