Skip to content

Commit 32b9762

Browse files
committed
[skip ci] working post and delete
1 parent a3c21cb commit 32b9762

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

services/static-webserver/client/source/class/osparc/data/model/Group.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ qx.Class.define("osparc.data.model.Group", {
3434
description: groupData.description,
3535
accessRights: groupData.accessRights,
3636
thumbnail: groupData.thumbnail,
37+
groupMembers: {},
3738
});
3839
},
3940

services/static-webserver/client/source/class/osparc/editor/OrganizationEditor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ qx.Class.define("osparc.editor.OrganizationEditor", {
4141
} else {
4242
const groupsStore = osparc.store.Groups.getInstance();
4343
const orgs = groupsStore.getOrganizations();
44-
const existingNames = orgs.map(org => org.getLabel());
44+
const existingNames = Object.values(orgs).map(org => org.getLabel());
4545
const defaultName = osparc.utils.Utils.getUniqueName("New Organization", existingNames)
4646
title.setValue(defaultName);
4747
}

services/static-webserver/client/source/class/osparc/store/Groups.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,10 +255,14 @@ qx.Class.define("osparc.store.Groups", {
255255
const params = {
256256
data: newGroupData
257257
};
258-
return osparc.data.Resources.getInstance().fetch("groups", "post", params)
258+
let group = null;
259+
return osparc.data.Resources.fetch("organizations", "post", params)
259260
.then(groupData => {
260-
const group = this.__addToGroupsCache(groupData, "organization");
261+
group = this.__addToGroupsCache(groupData, "organization");
261262
this.getOrganizations()[group.getGroupId()] = group;
263+
return this.__fetchGroupMembers(group.getGroupId());
264+
})
265+
.then(() => {
262266
return group;
263267
});
264268
},
@@ -269,7 +273,7 @@ qx.Class.define("osparc.store.Groups", {
269273
"gid": groupId
270274
}
271275
};
272-
return osparc.data.Resources.getInstance().fetch("groups", "delete", params)
276+
return osparc.data.Resources.fetch("organizations", "delete", params)
273277
.then(() => {
274278
this.__deleteFromGroupsCache(groupId);
275279
delete this.getOrganizations()[groupId];

0 commit comments

Comments
 (0)