File tree 2 files changed +14
-8
lines changed
2 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ export class NlpEntityRepository extends BaseRepository<
48
48
* @param created - The newly created NLP entity document.
49
49
*/
50
50
async postCreate ( _created : NlpEntityDocument ) : Promise < void > {
51
- if ( ! _created ) {
51
+ if ( ! _created . builtin ) {
52
52
// Bypass builtin entities (probably fixtures)
53
53
this . eventEmitter . emit ( 'hook:nlpEntity:create' , _created ) ;
54
54
}
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright © 2024 Hexastack. All rights reserved.
2
+ * Copyright © 2025 Hexastack. All rights reserved.
3
3
*
4
4
* Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:
5
5
* 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.
@@ -42,9 +42,12 @@ export class NlpService {
42
42
const helper = await this . helperService . getDefaultNluHelper ( ) ;
43
43
const foreignId = await helper . addEntity ( entity ) ;
44
44
this . logger . debug ( 'New entity successfully synced!' , foreignId ) ;
45
- return await this . nlpEntityService . updateOne ( entity . _id , {
46
- foreign_id : foreignId ,
47
- } ) ;
45
+ return await this . nlpEntityService . updateOne (
46
+ { _id : entity . _id } ,
47
+ {
48
+ foreign_id : foreignId ,
49
+ } ,
50
+ ) ;
48
51
} catch ( err ) {
49
52
this . logger . error ( 'Unable to sync a new entity' , err ) ;
50
53
return entity ;
@@ -104,9 +107,12 @@ export class NlpService {
104
107
const helper = await this . helperService . getDefaultNluHelper ( ) ;
105
108
const foreignId = await helper . addValue ( value ) ;
106
109
this . logger . debug ( 'New value successfully synced!' , foreignId ) ;
107
- return await this . nlpValueService . updateOne ( value . _id , {
108
- foreign_id : foreignId ,
109
- } ) ;
110
+ return await this . nlpValueService . updateOne (
111
+ { _id : value . _id } ,
112
+ {
113
+ foreign_id : foreignId ,
114
+ } ,
115
+ ) ;
110
116
} catch ( err ) {
111
117
this . logger . error ( 'Unable to sync a new value' , err ) ;
112
118
return value ;
You can’t perform that action at this time.
0 commit comments