Skip to content

Commit 791ca00

Browse files
committed
fix(agiloft): address PR review feedback
1 parent 199767c commit 791ca00

3 files changed

Lines changed: 10 additions & 6 deletions

File tree

apps/sim/tools/agiloft/get_choice_line_id.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,16 @@ export const agiloftGetChoiceLineIdTool: ToolConfig<
104104
}
105105
}
106106

107+
if (choiceLineId === null) {
108+
return {
109+
success: false,
110+
output: { choiceLineId: null },
111+
error: `No choice line ID found for value "${params.value}" in field "${params.fieldName}"`,
112+
}
113+
}
114+
107115
return {
108-
success: data.success !== false && choiceLineId !== null,
116+
success: data.success !== false,
109117
output: { choiceLineId },
110118
}
111119
}

apps/sim/tools/agiloft/search_records.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,6 @@ export const agiloftSearchRecordsTool: ToolConfig<
100100
for (const item of result as Record<string, unknown>[]) {
101101
records.push(item)
102102
}
103-
} else if (Array.isArray(data)) {
104-
for (const item of data as Record<string, unknown>[]) {
105-
records.push(item)
106-
}
107103
} else {
108104
const lengthRaw = result.EWREST_length ?? data.EWREST_length
109105
const count = typeof lengthRaw === 'string' ? Number(lengthRaw) : (lengthRaw as number)

apps/sim/tools/agiloft/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ export function buildGetChoiceLineIdUrl(
249249
params: AgiloftGetChoiceLineIdParams
250250
): string {
251251
const field = encodeURIComponent(params.fieldName.trim())
252-
const value = encodeURIComponent(params.value)
252+
const value = encodeURIComponent(params.value.trim())
253253
return `${base}/ewws/EWGetChoiceLineId/.json?${buildEwBaseQuery(params)}&field=${field}&value=${value}`
254254
}
255255

0 commit comments

Comments
 (0)