Skip to content
This repository was archived by the owner on Jan 10, 2024. It is now read-only.

Commit 337a664

Browse files
committed
Update search to better align with REST API
REST API returns JSON Serialized List<SObject>, current RemoteTK controller serializes List<List<SObject>>, which is the default return of a SOSL query - this better aligns the RemoteTK implementation with the ForceTK REST API implementation for better interoperability and interchangability.
1 parent bed85b4 commit 337a664

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

RemoteTKController.cls

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,9 +280,11 @@ public class RemoteTKController {
280280

281281
@remoteAction
282282
public static String search(String sosl) {
283-
List<List<SObject>> result;
283+
List<SObject> result = new List<SObject>();
284284
try {
285-
result = Search.query(sosl);
285+
List<List<SObject>> searchResults = Search.query(sosl);
286+
for(List<SObject> sr : searchResults)
287+
result.addAll(sr);
286288
} catch (QueryException qe) {
287289
return makeError(qe.getMessage(), 'INVALID_SEARCH');
288290
} catch (SearchException se) {

0 commit comments

Comments
 (0)