Skip to content

Commit

Permalink
Merge pull request #9 from graywenn/fix/createReportApi
Browse files Browse the repository at this point in the history
fix createReportApi
  • Loading branch information
Mr-Xiao-Zhang authored Jun 15, 2022
2 parents be2dc9c + 6cf27de commit 028a156
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 028a156

Please sign in to comment.