When calling the createOrUpdate endpoint on the Dataset Controller,

return a DatasetWizardModel instead of the dataset's id
This commit is contained in:
George Kalampokis 2020-10-29 17:12:59 +02:00
parent 8677cc85b9
commit 2354d9bb5c
1 changed files with 3 additions and 3 deletions

View File

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