Skip to content
Snippets Groups Projects
Commit 210caacf authored by BEAUVAIS ANTOINE's avatar BEAUVAIS ANTOINE
Browse files

Modified item list call to return a 204 code for empty responses.

parent 9b5986d4
Branches
1 merge request!1Merge 'develop' changes into 'master'.
......@@ -13,6 +13,7 @@ import fr.unistra.sil.erp.back.db.DatabaseInterface;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
......@@ -67,6 +68,8 @@ public class ApiRetrieveInfoController implements IRetrieveInfoController {
if(res == null)
throw new ApiServerErrorException("Failed to query info.");
else if(res.isEmpty())
return ResponseEntity.noContent().build();
return new ResponseEntity<>(res, HttpStatus.OK);
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment