When calling the createOrUpdate endpoint on the Dataset Controller,
return a DatasetWizardModel instead of the dataset's id
This commit is contained in:
parent
8677cc85b9
commit
2354d9bb5c
|
@ -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<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()));
|
||||
ResponseEntity<ResponseItem<DatasetWizardModel>> createOrUpdate(@RequestBody DatasetWizardModel profile, Principal principal) throws Exception {
|
||||
DatasetWizardModel dataset = new DatasetWizardModel().fromDataModel(this.datasetManager.createOrUpdate(profile, principal));
|
||||
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<DatasetWizardModel>().status(ApiMessageCode.SUCCESS_MESSAGE).message("Created").payload(dataset));
|
||||
}
|
||||
|
||||
@Transactional
|
||||
|
|
Loading…
Reference in New Issue