@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.
22 lines • 1.06 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const Resource_js_1 = tslib_1.__importDefault(require("../../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.
*/
class ReadServiceResource extends Resource_js_1.default {
/**
* 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 });
}
}
exports.default = ReadServiceResource;
//# sourceMappingURL=ReadServiceResource.js.map