@mbanq/core-sdk-js / commands / GetSearchData
Function: GetSearchData()
GetSearchData(
query,data):Command<{data: {exactMatch:boolean;resource:string; };query:string; },object[]>
Defined in: src/commands/rest/loan.ts:815
Retrieves search data based on a query and resource type. This generic search endpoint allows searching across various resources such as loans, clients, etc.
Parameters
query
string
The search query string
data
exactMatch
boolean = ...
resource
string = ...
Returns
Command<{ data: { exactMatch: boolean; resource: string; }; query: string; }, object[]>
A Command that when executed returns the search results as a flat array
Example
typescript
// Search for clients matching "loan"
const searchCmd = GetSearchData('loan', { resource: SearchResource.CLIENTS, exactMatch: false });
const results = await searchCmd.execute(config);
console.log('Found entities:', results.length);
console.log('First entity:', results[0].entityName);