Fix Dataset Profile Delete

This commit is contained in:
Diamantis Tziotzios 2019-02-15 13:11:11 +02:00
parent d89aedebc6
commit 19d16072cd
3 changed files with 6 additions and 3 deletions

View File

@ -56,6 +56,7 @@ public class Admin extends BaseController {
eu.eudat.data.entities.DatasetProfile datasetprofile = this.getApiContext().getOperationsContext().getDatabaseRepository().getDatasetProfileDao().find(UUID.fromString(id));
datasetprofile.setDefinition(modelDefinition.getDefinition());
datasetprofile.setStatus(modelDefinition.getStatus());
datasetprofile.setLabel(modelDefinition.getLabel());
this.getApiContext().getOperationsContext().getDatabaseRepository().getDatasetProfileDao().createOrUpdate(datasetprofile);
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<UUID>().status(ApiMessageCode.NO_MESSAGE));
}

View File

@ -42,8 +42,9 @@ export class DatasetProfileService {
return this.http.post<DatasetProfile>(this.actionUrl + 'datasetprofile/clone/' + id, {});
}
delete(id: string): Observable<DatasetProfile> {
return this.http.delete<DatasetProfile>(this.actionUrl + id, {});
delete(id: string, data): Observable<DatasetProfile> {
return this.http.post<DatasetProfile>(this.actionUrl + 'addDmp/' + id, data);
//return this.http.delete<DatasetProfile>(this.actionUrl + id, {});
}
}

View File

@ -204,7 +204,8 @@ export class DatasetProfileEditorComponent extends BaseComponent implements OnIn
});
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
if (result) {
this.datasetProfileService.delete(this.datasetProfileId)
this.form.get('status').setValue(DatasetProfileEnum.DELETED);
this.datasetProfileService.delete(this.datasetProfileId,this.form.value)
.pipe(takeUntil(this._destroyed))
.subscribe(
complete => {