@coveo/platform-client
Version:
The main goal of this package is to provide an easy to configure and straightforward way of querying Coveo Cloud APIs using JavaScript.
18 lines • 877 B
JavaScript
import Resource from '../../Resource.js';
/**
* Extends Resource with a `buildPathWithOrg` method, that will fill in the optional `org` query parameter by default.
* It still allows "overriding" the org by specifying it explicitly in the parameters.
*/
export default class ReadServiceResource extends Resource {
/**
* Build the request path, handling the optional `org` query parameter.
* @param route The path part of the request.
* @param queryParams Optional query parameters object.
* If this object contains an `org` property, it will override the value from the configuration.
* @returns The request path including formatted query parameters.
*/
buildPathWithOrg(route, queryParams) {
return super.buildPath(route, { org: this.api.organizationId, ...queryParams });
}
}
//# sourceMappingURL=ReadServiceResource.js.map