subos-frontend 1.0.56 → 1.0.58
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/dist/index.js
CHANGED
|
@@ -109,12 +109,17 @@ var ENDPOINTS = {
|
|
|
109
109
|
};
|
|
110
110
|
|
|
111
111
|
// src/api/client.ts
|
|
112
|
-
async function apiRequest(endpoint, method = "GET", data, headers) {
|
|
112
|
+
async function apiRequest(endpoint, method = "GET", data, headers, excludeProjectId) {
|
|
113
113
|
try {
|
|
114
114
|
const url = `${getApiBaseUrl()}${endpoint}`;
|
|
115
|
+
const baseHeaders = getHeaders();
|
|
116
|
+
const finalHeaders = { ...baseHeaders, ...headers ?? {} };
|
|
117
|
+
if (excludeProjectId && "projectId" in finalHeaders) {
|
|
118
|
+
delete finalHeaders.projectId;
|
|
119
|
+
}
|
|
115
120
|
const options = {
|
|
116
121
|
method,
|
|
117
|
-
headers:
|
|
122
|
+
headers: finalHeaders,
|
|
118
123
|
credentials: "include"
|
|
119
124
|
};
|
|
120
125
|
if (data) {
|
|
@@ -174,7 +179,7 @@ var plansApi = {
|
|
|
174
179
|
var subscriptionApi = {
|
|
175
180
|
getActiveSubscription: async (externalId) => {
|
|
176
181
|
console.log("getDefaultProjectId", getDefaultProjectId());
|
|
177
|
-
return apiRequest(`${ENDPOINTS.SUBSCRIPTION}/${externalId}`, "GET", void 0,
|
|
182
|
+
return apiRequest(`${ENDPOINTS.SUBSCRIPTION}/${externalId}`, "GET", void 0, void 0, true);
|
|
178
183
|
},
|
|
179
184
|
cancelSubscription: async (externalId, options) => {
|
|
180
185
|
let endpoint = `${ENDPOINTS.SUBSCRIPTION}/${externalId}`;
|
|
@@ -2538,6 +2543,7 @@ var SubscriptionActionButtons = ({
|
|
|
2538
2543
|
if (!subscription) {
|
|
2539
2544
|
return { disabled: false, tooltip: void 0 };
|
|
2540
2545
|
}
|
|
2546
|
+
console.log("subscription", subscription);
|
|
2541
2547
|
const canceledOn = (_a = subscription.plan) == null ? void 0 : _a.canceledOn;
|
|
2542
2548
|
if (canceledOn) {
|
|
2543
2549
|
return {
|