File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -87,6 +87,8 @@ async function send(conversation) {
8787 let content = data . chat . choices [ 0 ] . message . content ;
8888 content = content . replace ( / ` ` ` j s o n \n | \n ` ` ` / g, '' ) ;
8989 content = JSON . parse ( content )
90+
91+ // TODO: check if careers exist else create
9092 let responseElement = document . querySelector ( '[openai="response"]' )
9193 if ( responseElement ) {
9294 let preValue = responseElement . getValue ( )
@@ -221,12 +223,7 @@ async function openaiAction(form) {
221223 continue
222224
223225 if ( element . getAttribute ( 'key' ) === 'careers' ) {
224- let Content = [ ]
225- if ( typeof content === 'string' )
226- content = JSON . parse ( content )
227- for ( let contentItem of content )
228- Content . push ( contentItem . name )
229- content = { previousCareers : Content }
226+ content = JSON . stringify ( { previousCareers : content } )
230227 }
231228
232229 if ( typeof content === 'string' )
You can’t perform that action at this time.
0 commit comments