Minor JSON fixes for SDK

This commit is contained in:
frikky
2023-05-11 11:39:01 +02:00
parent 30ba687d60
commit 70edb366a9
10 changed files with 521 additions and 306 deletions
+7 -8
View File
@@ -695,15 +695,12 @@ const Admin = (props) => {
const handleGetOrg = (orgId) => {
if (orgId.length === 0) {
alert.error(
"Organization ID not defined. Please contact us on https://shuffler.io if this persists logout."
);
alert.error("Organization ID not defined. Please contact us on https://shuffler.io if this persists logout.");
return;
}
// Just use this one?
var baseurl = globalUrl;
const url = baseurl + "/api/v1/orgs/" + orgId;
const url = `${globalUrl}/api/v1/orgs/${orgId}`
fetch(url, {
method: "GET",
credentials: "include",
@@ -719,7 +716,11 @@ const Admin = (props) => {
})
.then((responseJson) => {
if (responseJson["success"] === false) {
alert.error("Failed getting your org. If this persists, please contact support.");
if (responseJson.reason !== undefined) {
alert.error(responseJson.reason);
} else {
alert.error("Failed getting your org. If this persists, please contact support.");
}
} else {
if (
responseJson.sync_features === undefined ||
@@ -728,8 +729,6 @@ const Admin = (props) => {
responseJson.sync_features = {};
}
setSelectedOrganization(responseJson)
var lists = {
active: {