Skip to content

Commit

Permalink
fix createReportApi
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr_Xiao_Zhang committed Jun 15, 2022
1 parent be2dc9c commit 6cf27de
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/controllers/dingTalk.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
IUserCreateDto,
IUserUpdateDto,
} from '@dtos/dingTlak';
import { ICreateReport } from '@interfaces/dingTalk';
import { NestRes } from '@interfaces/nestbase';
import {
Body,
Expand Down Expand Up @@ -185,17 +186,19 @@ export class DingTalkController {
};
}
}
const params = {
const params: ICreateReport = {
contents: contents,
template_id: templeDetail.result.id,
to_userids: templeDetail.result.default_receivers.map((item) => {
return item.userid;
}),
to_chat: false,
to_cids: [config.dingTalk.conversationId],
dd_from: 'fenglin',
userid: req.user.dingTalkUserId,
};
templeDetail.result?.default_receivers &&
(params.to_userids = templeDetail.result.default_receivers.map((item) => {
return item.userid;
}));

const result = await this.dingTalkService.createReport(params);
if (result.errcode === 0) {
return true;
Expand Down

0 comments on commit 6cf27de

Please sign in to comment.