@bindu-dashing/dam-solution-v2 5.8.136 → 5.8.138
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.
|
@@ -30,7 +30,7 @@ export const DamConfigProvider = ({ children, config }) => {
|
|
|
30
30
|
const [showPaymentErr, setShowPaymentErr] = useState(false);
|
|
31
31
|
const [teamID, setTeamID] = useState(null);
|
|
32
32
|
const getToken = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
33
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
33
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
34
34
|
setLoading(true);
|
|
35
35
|
try {
|
|
36
36
|
const response = yield axios.post(getBaseUrl(appType) + USER_LOGIN, {
|
|
@@ -39,7 +39,6 @@ export const DamConfigProvider = ({ children, config }) => {
|
|
|
39
39
|
subdomain,
|
|
40
40
|
teams: teamIds,
|
|
41
41
|
});
|
|
42
|
-
console.log("Token response:", response === null || response === void 0 ? void 0 : response.data);
|
|
43
42
|
const token = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.access_token;
|
|
44
43
|
const userData = (_d = (_c = response === null || response === void 0 ? void 0 : response.data) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.user;
|
|
45
44
|
const brandData = (_f = (_e = response === null || response === void 0 ? void 0 : response.data) === null || _e === void 0 ? void 0 : _e.data) === null || _f === void 0 ? void 0 : _f.brand;
|
|
@@ -47,7 +46,7 @@ export const DamConfigProvider = ({ children, config }) => {
|
|
|
47
46
|
setDamUser(userData);
|
|
48
47
|
setLoading(false);
|
|
49
48
|
setBrand(brandData);
|
|
50
|
-
setTeamID((_h = (_g = response === null || response === void 0 ? void 0 : response.data) === null || _g === void 0 ? void 0 : _g.data) === null || _h === void 0 ? void 0 : _h.
|
|
49
|
+
setTeamID((_k = (_j = (_h = (_g = response === null || response === void 0 ? void 0 : response.data) === null || _g === void 0 ? void 0 : _g.data) === null || _h === void 0 ? void 0 : _h.brand) === null || _j === void 0 ? void 0 : _j.adminTeams) === null || _k === void 0 ? void 0 : _k[0]);
|
|
51
50
|
// Use initialRootFolderId if provided, otherwise use rootFolderId from API
|
|
52
51
|
const apiRootFolderId = get(response, "data.data.rootFolderId");
|
|
53
52
|
setRootFolderId(initialRootFolderId || apiRootFolderId);
|
|
@@ -59,7 +58,7 @@ export const DamConfigProvider = ({ children, config }) => {
|
|
|
59
58
|
}
|
|
60
59
|
catch (error) {
|
|
61
60
|
console.error("Error fetching token:", error);
|
|
62
|
-
if (((
|
|
61
|
+
if (((_l = error === null || error === void 0 ? void 0 : error.response) === null || _l === void 0 ? void 0 : _l.status) === 402) {
|
|
63
62
|
setShowPaymentErr(true);
|
|
64
63
|
}
|
|
65
64
|
setLoading(false);
|