File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,6 @@ export class Entry {
1010 private _urlPath : string ;
1111 protected _variants : string ;
1212 _queryParams : { [ key : string ] : string | number | string [ ] } = { } ;
13-
1413 constructor ( client : AxiosInstance , contentTypeUid : string , entryUid : string ) {
1514 this . _client = client ;
1615 this . _contentTypeUid = contentTypeUid ;
@@ -195,4 +194,22 @@ export class Entry {
195194
196195 return response ;
197196 }
197+
198+ /**
199+ * @method addParams
200+ * @memberof Entry
201+ * @description Adds a query parameter to the query.
202+ * @example
203+ * import contentstack from '@contentstack/delivery-sdk'
204+ *
205+ * const stack = contentstack.stack({ apiKey: "apiKey", deliveryToken: "deliveryToken", environment: "environment" });
206+ * const result = stack.contentType("contentTypeUid").entry().addParams({"key": "value"}).fetch()
207+ *
208+ * @returns {Entry }
209+ */
210+ addParams ( paramObj : { [ key : string ] : string | number | string [ ] } ) : Entry {
211+ this . _queryParams = { ...this . _queryParams , ...paramObj } ;
212+
213+ return this ;
214+ }
198215}
You can’t perform that action at this time.
0 commit comments