File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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 )
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments