dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #41438
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21118: Data value resource. Returning 201 on create and 200 on delete. Removed the produces=text/plain p...
------------------------------------------------------------
revno: 21118
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2015-11-18 18:38:41 +0100
message:
Data value resource. Returning 201 on create and 200 on delete. Removed the produces=text/plain part.
modified:
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/DataValueController.java
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/DataValueController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/DataValueController.java 2015-10-22 23:43:32 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/DataValueController.java 2015-11-18 17:38:41 +0000
@@ -67,12 +67,14 @@
import org.hisp.dhis.webapi.utils.WebMessageUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpStatus;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseStatus;
import com.google.common.io.ByteSource;
@@ -120,8 +122,9 @@
// POST
// ---------------------------------------------------------------------
+ @ResponseStatus( HttpStatus.CREATED )
@PreAuthorize( "hasRole('ALL') or hasRole('F_DATAVALUE_ADD')" )
- @RequestMapping( method = RequestMethod.POST, produces = "text/plain" )
+ @RequestMapping( method = RequestMethod.POST )
public void saveDataValue(
@RequestParam String de,
@RequestParam( required = false ) String co,
@@ -292,8 +295,9 @@
// DELETE
// ---------------------------------------------------------------------
+ @ResponseStatus( HttpStatus.NO_CONTENT )
@PreAuthorize( "hasRole('ALL') or hasRole('F_DATAVALUE_DELETE')" )
- @RequestMapping( method = RequestMethod.DELETE, produces = "text/plain" )
+ @RequestMapping( method = RequestMethod.DELETE )
public void deleteDataValue(
@RequestParam String de,
@RequestParam( required = false ) String co,