Merge branch 'dmgt-ra/certificate/bug' into 'master'

Fix certification deletion issue in devicemgt react app

Closes product-iots#299

See merge request entgra/carbon-device-mgt!413
feature/appm-store/pbac
Dharmakeerthi Lasantha 5 years ago
commit eda30dcf94

@ -306,8 +306,9 @@ public interface CertificateManagementAdminService {
@DELETE @DELETE
@Path("/{serialNumber}") @Path("/{serialNumber}")
@Consumes(MediaType.WILDCARD)
@ApiOperation( @ApiOperation(
consumes = MediaType.APPLICATION_JSON, consumes = MediaType.WILDCARD,
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
httpMethod = "DELETE", httpMethod = "DELETE",
value = "Deleting an SSL Certificate", value = "Deleting an SSL Certificate",

@ -18,6 +18,7 @@
package org.wso2.carbon.certificate.mgt.cert.jaxrs.api.impl; package org.wso2.carbon.certificate.mgt.cert.jaxrs.api.impl;
import javax.ws.rs.core.MediaType;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.certificate.mgt.cert.jaxrs.api.CertificateManagementAdminService; import org.wso2.carbon.certificate.mgt.cert.jaxrs.api.CertificateManagementAdminService;
@ -145,6 +146,7 @@ public class CertificateManagementAdminServiceImpl implements CertificateManagem
@DELETE @DELETE
@Path("/{serialNumber}") @Path("/{serialNumber}")
@Consumes(MediaType.WILDCARD)
public Response removeCertificate(@PathParam("serialNumber") String serialNumber) { public Response removeCertificate(@PathParam("serialNumber") String serialNumber) {
RequestValidationUtil.validateSerialNumber(serialNumber); RequestValidationUtil.validateSerialNumber(serialNumber);
@ -328,4 +330,4 @@ public class CertificateManagementAdminServiceImpl implements CertificateManagem
} }
return Response.status(Response.Status.OK).entity("invalid").build(); return Response.status(Response.Status.OK).entity("invalid").build();
} }
} }

@ -114,6 +114,7 @@ class CertificateTable extends React.Component {
{headers: {'Content-Type': 'application/json'}} {headers: {'Content-Type': 'application/json'}}
).then(res => { ).then(res => {
if (res.status === 200) { if (res.status === 200) {
this.fetch();
notification["success"]({ notification["success"]({
message: "Done", message: "Done",
duration: 4, duration: 4,
@ -202,8 +203,6 @@ class CertificateTable extends React.Component {
} }
]; ];
render() { render() {
const {data, pagination, loading} = this.state; const {data, pagination, loading} = this.state;

Loading…
Cancel
Save