|
@@ -101,10 +101,12 @@ export class ContactApplyController {
|
|
|
|
|
|
const userData = get(otherData, 'userData');
|
|
|
|
|
|
+
|
|
|
if (!skipCheckList.includes(source)) {
|
|
|
- if (!userData) throw new ServiceError(ErrorCode.CONTACTAPPLY_TARGET_USER_NOT_FOUND);
|
|
|
- const target_user = get(userData, 'id');
|
|
|
- data['target_user'] = target_user;
|
|
|
+ if (userData) {
|
|
|
+ const target_user = get(userData, 'id');
|
|
|
+ data['target_user'] = target_user;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
await this.service.checkHasApply(data);
|
|
@@ -115,8 +117,9 @@ export class ContactApplyController {
|
|
|
|
|
|
if (!keyword) throw new ServiceError(ErrorCode.CONTACTAPPLY_NO_KEYWORD);
|
|
|
|
|
|
- const result = await this.esService.getCS(keyword, source);
|
|
|
+ const result = await this.esService.getCS(keyword, source, source_id);
|
|
|
if (!result) throw new ServiceError(ErrorCode.CONTACTAPPLY_MATCHING_NOT_ENOUGH);
|
|
|
+ return;
|
|
|
}
|
|
|
|
|
|
const dbData = await this.service.create(data);
|