forked from Yara724/api
Fixed company code error not found
This commit is contained in:
@@ -1068,10 +1068,19 @@ export class RequestManagementService {
|
||||
const companyCode = inquiryMapped?.CompanyCode;
|
||||
const client =
|
||||
await this.clientService.findClientWithCompanyCode(+companyCode);
|
||||
|
||||
if (!client) {
|
||||
throw new HttpException("Client not found", HttpStatus.CONFLICT);
|
||||
await this.clientService.addClient({
|
||||
clientName,
|
||||
clientCode: companyCode,
|
||||
useExpertMode: "legal",
|
||||
});
|
||||
}
|
||||
|
||||
// if (!client) {
|
||||
// throw new HttpException("Client not found", HttpStatus.CONFLICT);
|
||||
// }
|
||||
|
||||
// Persist inquiry/body data into new model
|
||||
if (!party.person) party.person = {} as any;
|
||||
const resolvedClientId = (client as any)?._id ?? (client as any)?._doc?._id;
|
||||
|
||||
Reference in New Issue
Block a user