@hubs101/js-api-skd-client 1.0.10385 → 1.0.10387
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.
- package/lib/api/event/index.d.ts +1 -1
- package/lib/api/event/index.js +4 -2
- package/lib/index.js +3 -3
- package/lib/types/base.d.ts +2 -2
- package/package.json +1 -1
package/lib/api/event/index.d.ts
CHANGED
|
@@ -110,7 +110,7 @@ export declare const _updatePortfolio: (basePath: string, token: string, portfol
|
|
|
110
110
|
}[]) => Promise<any>;
|
|
111
111
|
export declare const _fetchPortfolioDetails: (basePath: string, token: string, portfolioId: string) => Promise<Portfolio>;
|
|
112
112
|
export declare const _fetchPortfolioEvents: (basePath: string, token: string, portfolioId: string) => Promise<Event[]>;
|
|
113
|
-
export declare const _fetchBlogPages: (basePath: string, token: string, portfolioId: string) => Promise<BlogPage[]>;
|
|
113
|
+
export declare const _fetchBlogPages: (basePath: string, token: string, accountId: string, portfolioId: string) => Promise<BlogPage[]>;
|
|
114
114
|
export declare const _createBlogPage: (basePath: string, token: string, portfolioId: string, data: BlogPageInput, files: {
|
|
115
115
|
name: string;
|
|
116
116
|
value: File;
|
package/lib/api/event/index.js
CHANGED
|
@@ -605,9 +605,11 @@ const _fetchPortfolioEvents = (basePath, token, portfolioId) => __awaiter(void 0
|
|
|
605
605
|
return (portfolioEvents === null || portfolioEvents === void 0 ? void 0 : portfolioEvents.data) || portfolioEvents;
|
|
606
606
|
});
|
|
607
607
|
exports._fetchPortfolioEvents = _fetchPortfolioEvents;
|
|
608
|
-
const _fetchBlogPages = (basePath, token, portfolioId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
608
|
+
const _fetchBlogPages = (basePath, token, accountId, portfolioId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
609
609
|
const base = (0, base_1.getBasePath)(basePath);
|
|
610
|
-
const { data: portfolioPages } = yield (0, api_1.getRequest)(
|
|
610
|
+
const { data: portfolioPages } = yield (0, api_1.getRequest)(portfolioId
|
|
611
|
+
? `${base.ACCOUNTS}/${accountId}/pages?portfolio=${portfolioId}`
|
|
612
|
+
: `${base.ACCOUNTS}/${accountId}/pages`, token);
|
|
611
613
|
return (portfolioPages === null || portfolioPages === void 0 ? void 0 : portfolioPages.data) || portfolioPages;
|
|
612
614
|
});
|
|
613
615
|
exports._fetchBlogPages = _fetchBlogPages;
|
package/lib/index.js
CHANGED
|
@@ -869,13 +869,13 @@ function EventAPIProvider(props) {
|
|
|
869
869
|
(0, api_1.validateConfig)(config);
|
|
870
870
|
return (0, event_1._fetchPortfolioEvents)(config.baseUrl, config.token, portfolioId);
|
|
871
871
|
}), [config, config.baseUrl, config.token]);
|
|
872
|
-
const fetchBlogPages = react_1.default.useCallback((portfolioId) => __awaiter(this, void 0, void 0, function* () {
|
|
872
|
+
const fetchBlogPages = react_1.default.useCallback((accountId, portfolioId) => __awaiter(this, void 0, void 0, function* () {
|
|
873
873
|
(0, api_1.validateConfig)(config);
|
|
874
|
-
return (0, event_1._fetchBlogPages)(config.baseUrl, config.token, portfolioId);
|
|
874
|
+
return (0, event_1._fetchBlogPages)(config.baseUrl, config.token, accountId, portfolioId);
|
|
875
875
|
}), [config, config.baseUrl, config.token]);
|
|
876
876
|
const createBlogPage = react_1.default.useCallback((portfolioId, data, files) => __awaiter(this, void 0, void 0, function* () {
|
|
877
877
|
(0, api_1.validateConfig)(config);
|
|
878
|
-
return (0, event_1._createBlogPage)(
|
|
878
|
+
return (0, event_1._createBlogPage)(config.baseUrl, config.token, portfolioId, data, files);
|
|
879
879
|
}), [config, config.baseUrl, config.token]);
|
|
880
880
|
return (react_1.default.createElement(EventAPIContext_1.default.Provider, { value: {
|
|
881
881
|
config,
|
package/lib/types/base.d.ts
CHANGED
|
@@ -296,7 +296,7 @@ export type BaseAPIType = {
|
|
|
296
296
|
name: string;
|
|
297
297
|
value: File;
|
|
298
298
|
}[]) => Promise<BlogPage>;
|
|
299
|
-
fetchBlogPages: (basePath: string, token: string,
|
|
299
|
+
fetchBlogPages: (basePath: string, token: string, accountId: string, portfolioId?: string) => Promise<BlogPage[]>;
|
|
300
300
|
};
|
|
301
301
|
export type EventAPIType = {
|
|
302
302
|
config: BaseAPIConfigType;
|
|
@@ -522,7 +522,7 @@ export type EventAPIType = {
|
|
|
522
522
|
name: string;
|
|
523
523
|
value: File;
|
|
524
524
|
}[]) => Promise<BlogPage>;
|
|
525
|
-
fetchBlogPages: (
|
|
525
|
+
fetchBlogPages: (accountId: string, portfolioId?: string) => Promise<BlogPage[]>;
|
|
526
526
|
};
|
|
527
527
|
export type BaseAPIConfigType = {
|
|
528
528
|
baseUrl?: string;
|