Create or update dataset endpoint will return the id of the

created/updated dataset
This commit is contained in:
George Kalampokis 2020-09-17 13:31:07 +03:00
parent d2251d1015
commit 9b403bb480
1 changed files with 3 additions and 3 deletions

View File

@ -247,9 +247,9 @@ public class Datasets extends BaseController {
@javax.transaction.Transactional
@RequestMapping(method = RequestMethod.POST, consumes = "application/json", produces = "application/json")
public @ResponseBody
ResponseEntity<ResponseItem<Dataset>> createOrUpdate(@RequestBody DatasetWizardModel profile, Principal principal) throws Exception {
this.datasetManager.createOrUpdate(profile, principal);
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<eu.eudat.data.entities.Dataset>().status(ApiMessageCode.SUCCESS_MESSAGE).message("Created").payload(null));
ResponseEntity<ResponseItem<UUID>> createOrUpdate(@RequestBody DatasetWizardModel profile, Principal principal) throws Exception {
Dataset dataset = this.datasetManager.createOrUpdate(profile, principal);
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<UUID>().status(ApiMessageCode.SUCCESS_MESSAGE).message("Created").payload(dataset.getId()));
}
@Transactional