diff --git a/src/components/forms/LogVisitForm.tsx b/src/components/forms/LogVisitForm.tsx index c746dab..4bf547a 100644 --- a/src/components/forms/LogVisitForm.tsx +++ b/src/components/forms/LogVisitForm.tsx @@ -176,7 +176,7 @@ export function LogVisitForm({ client, onSuccess, onCancel, onActivityChange }: try { const formDataToSend = cleanFormData(formDataOverride || valuesRef.current); - console.log('[LogVisitForm] Executing select_store lookup with prefilled formData:', formDataToSend); + const lookupRes = await client.wfLookupRecords({ activityId, @@ -239,7 +239,7 @@ export function LogVisitForm({ client, onSuccess, onCancel, onActivityChange }: time_of_visit: timeVal, }); - console.log('[LogVisitForm] Fetching initial daily_log lookup with payload:', payload); + const dailyLogLookupRes = await client.wfLookupRecords({ activityId, @@ -254,7 +254,7 @@ export function LogVisitForm({ client, onSuccess, onCancel, onActivityChange }: if (arr.length > 0) { const firstLog = arr[0]; - console.log('[LogVisitForm] Successfully fetched daily log record:', firstLog); + const dailyLogInstanceId = String(firstLog.instance_id || firstLog.id || ''); const routeCode = String( @@ -291,7 +291,7 @@ export function LogVisitForm({ client, onSuccess, onCancel, onActivityChange }: valuesRef.current = updated; setValues(updated); - console.log('[LogVisitForm] Daily log prefill complete:', updated); + } else { console.warn('[LogVisitForm] No daily log records found for date/time:', dateVal, timeVal); } @@ -370,14 +370,14 @@ export function LogVisitForm({ client, onSuccess, onCancel, onActivityChange }: } payload['upload_image'] = uploadedFiles; - console.log('[LogVisitForm] Submitting clean startInstance payload:', payload); + const res: any = await client.startInstance(activityId, payload); const chainSource = res?.activity_chain || schema?.activity_chain || []; if (chainSource && chainSource.length > 0) { const nextAct = chainSource[0]; - console.log('[LogVisitForm] Activity chain detected, transitioning to DynamicForm:', nextAct); + onActivityChange?.(nextAct.activity_name); setChainedActivity({ diff --git a/src/components/rv/RecordView.tsx b/src/components/rv/RecordView.tsx index 1e8bbfe..588cd4b 100644 --- a/src/components/rv/RecordView.tsx +++ b/src/components/rv/RecordView.tsx @@ -135,7 +135,7 @@ export function RecordView({ sortDir, presetAlias }); - console.log("RECORD VIEW RESP:", r); + if (live) setResp(r); } catch (e) { if (live) setError((e as { message?: string })?.message ?? 'Failed to load');