|
@@ -43,12 +43,11 @@ export class MessageController extends BaseController {
|
|
|
@Query('skip') skip: number,
|
|
|
@Query('limit') limit: number
|
|
|
) {
|
|
|
- const list = await this.service.query(filter, { skip, limit });
|
|
|
- const data = [];
|
|
|
- for (const i of list) {
|
|
|
- const newData = new QVO_message(i);
|
|
|
- data.push(newData);
|
|
|
- }
|
|
|
+ const data = await this.service.query(filter, {
|
|
|
+ skip,
|
|
|
+ limit,
|
|
|
+ sort: { 'meta.createdAt': -1 },
|
|
|
+ });
|
|
|
const total = await this.service.count(filter);
|
|
|
return { data, total };
|
|
|
}
|