From b623446ec0e71a3f696d14c3f169781c99f7e7b7 Mon Sep 17 00:00:00 2001
From: Nathan-SR <144961007+Nathan-SR@users.noreply.github.com>
Date: Wed, 26 Feb 2025 17:01:41 -0500
Subject: field type changing works

---
 .../nodes/DataVizBox/DocCreatorMenu/DocCreatorMenu.tsx     | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

(limited to 'src/client/views/nodes/DataVizBox/DocCreatorMenu/DocCreatorMenu.tsx')

diff --git a/src/client/views/nodes/DataVizBox/DocCreatorMenu/DocCreatorMenu.tsx b/src/client/views/nodes/DataVizBox/DocCreatorMenu/DocCreatorMenu.tsx
index 6f3647133..faa6cffa8 100644
--- a/src/client/views/nodes/DataVizBox/DocCreatorMenu/DocCreatorMenu.tsx
+++ b/src/client/views/nodes/DataVizBox/DocCreatorMenu/DocCreatorMenu.tsx
@@ -568,17 +568,13 @@ export class DocCreatorMenu extends ObservableReactComponent<FieldViewProps> {
 
         let prompt: string = `(${origCount}) ${inputText}`;
 
-        console.log('prompt is: ', prompt)
-
         this._GPTLoading = true;
 
         try {
             const res = await gptAPICall(prompt, GPTCallType.TEMPLATE);
 
             if (res) {
-                console.log('res is: ', res)
                 const assignments: { [templateTitle: string]: { [fieldID: string]: string } } = JSON.parse(res);
-                console.log('assignments: ', assignments)
                 const brokenDownAssignments: [Template, { [fieldID: number]: Col }][] = [];
 
                 Object.entries(assignments).forEach(([tempTitle, assignment]) => {
@@ -598,9 +594,7 @@ export class DocCreatorMenu extends ObservableReactComponent<FieldViewProps> {
                         },
                         {} as { [field: number]: Col }
                     );
-                    console.log('all assignments: ', toObj)
                     brokenDownAssignments.push([template, toObj]);
-                    console.log('brokendownassignments: ', brokenDownAssignments)
                 });
 
                 return brokenDownAssignments;
@@ -733,14 +727,14 @@ export class DocCreatorMenu extends ObservableReactComponent<FieldViewProps> {
 
             fields.filter(title => title).forEach(title => {
                 const field = templateCopy.getFieldByTitle(title);
-                if (field === undefined) { return };
-                field.setContent(content[title]);
+                if (field === undefined) return;
+                field.setContent(content[title], field.viewType);
             });
     
             const gptPromises = this._userCreatedFields.filter(field => field.type === TemplateFieldType.TEXT).map(field => {
                 const title = field.title;
                 const templateField = templateCopy.getFieldByTitle(title);
-                if (templateField === undefined) { return };
+                if (templateField === undefined) return;
                 const templatefieldID = templateField.getID;
     
                 return this.renderGPTTextCall(templateCopy, field, templatefieldID);
@@ -749,7 +743,7 @@ export class DocCreatorMenu extends ObservableReactComponent<FieldViewProps> {
             const imagePromises = this._userCreatedFields.filter(field => field.type === TemplateFieldType.VISUAL).map(field => {
                 const title = field.title;
                 const templateField = templateCopy.getFieldByTitle(title);
-                if (templateField === undefined) { return };
+                if (templateField === undefined) return;
                 const templatefieldID = templateField.getID;
     
                 return this.renderGPTImageCall(templateCopy, field, templatefieldID);
-- 
cgit v1.2.3-70-g09d2

