@hubs101/js-api-skd-client 1.0.10558 → 1.0.10559

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -107,7 +107,7 @@ export declare const _createOffer: (basePath: string, token: string, accountId:
107
107
  name: string;
108
108
  value: File;
109
109
  }[]) => Promise<OfferServerResponse>;
110
- export declare const _fetchOffers: (basePath: string, token: string, accountId: string) => Promise<OfferServerResponse[]>;
110
+ export declare const _fetchOffers: (basePath: string, token: string, accountId: string, params?: string) => Promise<OfferServerResponse[]>;
111
111
  export declare const _fetchOfferDetails: (basePath: string, token: string, accountId: string, offerId: string) => Promise<OfferServerResponse>;
112
112
  export declare const _updateOffer: (basePath: string, token: string, accountId: string, offerId: string, data: CreateOfferInput, files?: {
113
113
  name: string;
@@ -595,9 +595,12 @@ const _createOffer = (basePath_1, token_1, accountId_1, data_1, ...args_1) => __
595
595
  return createdOffer;
596
596
  });
597
597
  exports._createOffer = _createOffer;
598
- const _fetchOffers = (basePath, token, accountId) => __awaiter(void 0, void 0, void 0, function* () {
598
+ const _fetchOffers = (basePath, token, accountId, params) => __awaiter(void 0, void 0, void 0, function* () {
599
599
  const base = (0, base_1.getBasePath)(basePath);
600
- const { data: offers } = yield (0, api_1.getRequest)(`${base.ACCOUNTS}/${accountId}/offers`, token);
600
+ const url = params
601
+ ? `${base.ACCOUNTS}/${accountId}/offers?${params}`
602
+ : `${base.ACCOUNTS}/${accountId}/offers`;
603
+ const { data: offers } = yield (0, api_1.getRequest)(url, token);
601
604
  return (offers === null || offers === void 0 ? void 0 : offers.data) || offers;
602
605
  });
603
606
  exports._fetchOffers = _fetchOffers;
package/lib/index.js CHANGED
@@ -204,9 +204,9 @@ function EventAPIProvider(props) {
204
204
  (0, api_1.validateConfig)(config);
205
205
  return (0, event_1._createOffer)(config.baseUrl, config.token, accountId, body, files);
206
206
  }), [config, config.baseUrl, config.token]);
207
- const fetchOffers = (0, react_1.useCallback)((accountId) => __awaiter(this, void 0, void 0, function* () {
207
+ const fetchOffers = (0, react_1.useCallback)((accountId, params) => __awaiter(this, void 0, void 0, function* () {
208
208
  (0, api_1.validateConfig)(config);
209
- return (0, event_1._fetchOffers)(config.baseUrl, config.token, accountId);
209
+ return (0, event_1._fetchOffers)(config.baseUrl, config.token, accountId, params);
210
210
  }), [config, config.baseUrl, config.token]);
211
211
  const fetchOfferDetails = (0, react_1.useCallback)((accountId, offerId) => __awaiter(this, void 0, void 0, function* () {
212
212
  (0, api_1.validateConfig)(config);
@@ -76,7 +76,7 @@ export type ClientBase = {
76
76
  };
77
77
  export type BaseAPIType = {
78
78
  createOffer: (basePath: string, token: string, accountId: string, body: CreateOfferInput, files: any[]) => Promise<OfferServerResponse>;
79
- fetchOffers: (basePath: string, token: string, accountId: string) => Promise<OfferServerResponse[]>;
79
+ fetchOffers: (basePath: string, token: string, accountId: string, params?: string) => Promise<OfferServerResponse[]>;
80
80
  fetchOfferDetails: (basePath: string, token: string, accountId: string, offerId: string) => Promise<OfferServerResponse>;
81
81
  updateOffer: (basePath: string, token: string, accountId: string, offerId: string, body: CreateOfferInput, files: any[]) => Promise<OfferServerResponse>;
82
82
  fetchEventRegistrations: (basePath: string, token: string, eventId: string) => Promise<EventRegistration[]>;
@@ -638,7 +638,7 @@ export type EventAPIType = {
638
638
  updateFeed: (accountId: string, feedId: string, data: FeedInputType, files: any[]) => Promise<FeedType>;
639
639
  deleteFeed: (accountId: string, feedId: string) => Promise<any>;
640
640
  createOffer: (accountId: string, body: CreateOfferInput, files: any[]) => Promise<OfferServerResponse>;
641
- fetchOffers: (accountId: string) => Promise<OfferServerResponse[]>;
641
+ fetchOffers: (accountId: string, params?: string) => Promise<OfferServerResponse[]>;
642
642
  fetchOfferDetails: (accountId: string, offerId: string) => Promise<OfferServerResponse>;
643
643
  updateOffer: (accountId: string, offerId: string, body: CreateOfferInput, files: any[]) => Promise<OfferServerResponse>;
644
644
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hubs101/js-api-skd-client",
3
- "version": "1.0.10558",
3
+ "version": "1.0.10559",
4
4
  "author": "Liveware",
5
5
  "scripts": {
6
6
  "test": "jest --config jestconfig.json",