mirror of
https://github.com/hexastack/hexabot
synced 2025-06-26 18:27:28 +00:00
fix: apply feedbacks
This commit is contained in:
@@ -91,7 +91,7 @@ export class NlpSampleController extends BaseController<
|
||||
);
|
||||
const entities = await this.nlpEntityService.findAllAndPopulate();
|
||||
const helper = await this.helperService.getDefaultNluHelper();
|
||||
const result = await helper.format?.(samples, entities);
|
||||
const result = await helper.format(samples, entities);
|
||||
|
||||
// Sending the JSON data as a file
|
||||
const buffer = Buffer.from(JSON.stringify(result));
|
||||
@@ -129,11 +129,6 @@ export class NlpSampleController extends BaseController<
|
||||
): Promise<NlpSampleFull> {
|
||||
const language = await this.languageService.getLanguageByCode(languageCode);
|
||||
|
||||
if (!language)
|
||||
throw new NotFoundException(
|
||||
`Language with code ${languageCode} not found`,
|
||||
);
|
||||
|
||||
const nlpSample = await this.nlpSampleService.create({
|
||||
...createNlpSampleDto,
|
||||
language: language.id,
|
||||
@@ -303,13 +298,6 @@ export class NlpSampleController extends BaseController<
|
||||
): Promise<NlpSampleFull> {
|
||||
const language = await this.languageService.getLanguageByCode(languageCode);
|
||||
|
||||
if (!language) {
|
||||
this.logger.warn(`Unable to Language by languageCode ${languageCode}`);
|
||||
throw new NotFoundException(
|
||||
`Language with languageCode ${languageCode} not found`,
|
||||
);
|
||||
}
|
||||
|
||||
const sample = await this.nlpSampleService.updateOne(id, {
|
||||
...sampleAttrs,
|
||||
language: language.id,
|
||||
|
||||
Reference in New Issue
Block a user