quickbooks-api
Version:
A modular TypeScript SDK for seamless integration with Intuit QuickBooks APIs. Provides robust authentication handling and future-ready foundation for accounting, payments, and commerce operations.
26 lines (25 loc) • 832 B
JavaScript
/**
* Get All Preferences
* @param this - The Preference API
* @returns The Preferences
*/
export async function getPreferences(options = {}) {
// Get the Query Builder
const queryBuilder = await this.getQueryBuilder();
// Setup the Search Options (if provided)
if (options.searchOptions)
queryBuilder.setSearchOptions(options.searchOptions);
// Setup the URL
const url = queryBuilder.build();
// Get the Preferences
const response = await this.apiClient.runRequest(url, { method: 'GET' });
// Format the Response
let preferences = this.formatResponse(response);
// Setup the Search Response
const searchResponse = {
results: preferences,
hasNextPage: await this.hasNextPage(queryBuilder),
};
// Return the Preferences
return searchResponse;
}