lrf пре 1 година
родитељ
комит
3b60b9db3e
1 измењених фајлова са 2 додато и 3 уклоњено
  1. 2 3
      src/service/chat.service.ts

+ 2 - 3
src/service/chat.service.ts

@@ -3,7 +3,7 @@ import { InjectEntityModel } from '@midwayjs/typegoose';
 import { ReturnModelType } from '@typegoose/typegoose';
 import { BaseService, PageOptions, SearchBase } from 'free-midway-component';
 import { Chat } from '../entity/chat.entity';
-import { cloneDeep } from 'lodash';
+import { cloneDeep, get, head } from 'lodash';
 import { ChatMqService } from './chatMq.service';
 import { Types } from 'mongoose';
 import { JwtService } from '@midwayjs/jwt';
@@ -124,7 +124,6 @@ export class ChatService extends BaseService<modelType> {
     if (skip && skip >= 0) pipes.push({ $skip: skip });
     if (limit && limit > 0) pipes.push({ $limit: limit });
     const result = await this.model.aggregate(pipes);
-    // return { data: result, total: get(head(totalResult), 'total') };
-    return { data: result, total: 0 };
+    return { data: result, total: get(head(totalResult), 'total') };
   }
 }