diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.group.create/public/js/group-add.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.group.create/public/js/group-add.js
index a259a6e361..2dc32ce70f 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.group.create/public/js/group-add.js
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.group.create/public/js/group-add.js
@@ -59,7 +59,7 @@ $(function () {
}
};
- invokerUtil.post("/devicemgt_admin/groups", group,
+ invokerUtil.post("/api/device-mgt/v1.0/groups", group,
successCallback, function (message) {
displayErrors(message);
});
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/public/js/listing.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/public/js/listing.js
index a9ab2d5216..140ba33559 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/public/js/listing.js
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.groups/public/js/listing.js
@@ -170,10 +170,10 @@ function loadGroups() {
'Share';
html += '' +
+ 'data-group-owner="' + row.owner + '" data-group-description="' + row.description + '" data-group-id="'+row.groupId+'">' +
'Edit';
- html += '' +
'Delete';
@@ -351,7 +351,7 @@ function attachEvents() {
* on Group Management page in WSO2 IoT Server Console.
*/
$("a.remove-group-link").click(function () {
- var groupName = $(this).data("group-name");
+ var groupId = $(this).data("group-id");
var groupOwner = $(this).data("group-owner");
$(modalPopupContent).html($('#remove-group-modal-content').html());
@@ -359,7 +359,6 @@ function attachEvents() {
$("a#remove-group-yes-link").click(function () {
var successCallback = function (data, textStatus, xhr) {
- data = JSON.parse(data);
if (xhr.status == 200) {
$(modalPopupContent).html($('#remove-group-200-content').html());
setTimeout(function () {
@@ -371,7 +370,7 @@ function attachEvents() {
}
};
- invokerUtil.delete("/devicemgt_admin/groups/owner/" + groupOwner + "/name/" + groupName,
+ invokerUtil.delete("/api/device-mgt/v1.0/groups/id/" + groupId,
successCallback, function (message) {
displayErrors(message);
});
@@ -389,6 +388,7 @@ function attachEvents() {
* on Device Management page in WSO2 MDM Console.
*/
$("a.edit-group-link").click(function () {
+ var groupId = $(this).data("group-id");
var groupName = $(this).data("group-name");
var groupOwner = $(this).data("group-owner");
var groupDescription = $(this).data("group-description");
@@ -404,8 +404,8 @@ function attachEvents() {
var group = {"name": newGroupName, "description": newGroupDescription, "owner": groupOwner};
var successCallback = function (data, textStatus, xhr) {
- data = JSON.parse(data);
if (xhr.status == 200) {
+ $(modalPopupContent).html($('#edit-group-200-content').html());
setTimeout(function () {
hidePopup();
location.reload(false);
@@ -415,7 +415,7 @@ function attachEvents() {
}
};
- invokerUtil.put("/devicemgt_admin/groups/owner/" + groupOwner + "/name/" + groupName, group,
+ invokerUtil.put("/api/device-mgt/v1.0/groups/id/" + groupId, group,
successCallback, function (message) {
displayErrors(message);
});