Fix: Add default 'Menu' category when no categories found
Toast extraction was finding items but no h2.groupHeader categories, leaving items ungrouped. showItemsStep() then rendered no checkboxes, and confirmItems() filtered out all items (empty checkedIds set). Now adds a default "Menu" category when items exist but categories is empty. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
b081e72347
commit
09e5807c94
1 changed files with 6 additions and 0 deletions
|
|
@ -356,6 +356,12 @@
|
|||
</cfif>
|
||||
</cfif>
|
||||
|
||||
<!--- If we have items but no categories, add a default "Menu" category --->
|
||||
<cfif arrayLen(toastItems) GT 0 AND arrayLen(toastCategories) EQ 0>
|
||||
<cfset arrayAppend(toastCategories, { "name": "Menu", "itemCount": arrayLen(toastItems) })>
|
||||
<cfset arrayAppend(response.steps, "Added default 'Menu' category for " & arrayLen(toastItems) & " items")>
|
||||
</cfif>
|
||||
|
||||
<cfset arrayAppend(response.steps, "Extracted " & arrayLen(toastItems) & " unique items from " & arrayLen(toastCategories) & " categories")>
|
||||
<!--- Summary of business info found --->
|
||||
<cfset bizKeys = structKeyList(toastBusiness)>
|
||||
|
|
|
|||
Reference in a new issue