commented out the create method until the spec for POST responses is final

This commit is contained in:
Art Lowel
2018-01-11 10:40:31 +01:00
parent 0010f9d704
commit eb37488296

View File

@@ -110,20 +110,21 @@ export abstract class DataService<TNormalized extends CacheableObject, TDomain>
return this.rdbService.buildSingle<TNormalized, TDomain>(href, this.normalizedResourceType);
}
create(dso: DSpaceObject): Observable<RemoteData<TDomain>> {
const postHrefObs = this.getEndpoint();
// TODO ID is unknown at this point
const idHrefObs = postHrefObs.map((href: string) => this.getFindByIDHref(href, dso.id));
postHrefObs
.filter((href: string) => hasValue(href))
.take(1)
.subscribe((href: string) => {
const request = new RestRequest(this.requestService.generateRequestId(), href, RestRequestMethod.Post, dso);
this.requestService.configure(request);
});
return this.rdbService.buildSingle<TNormalized, TDomain>(idHrefObs, this.normalizedResourceType);
}
// TODO implement, after the structure of the REST server's POST response is finalized
// create(dso: DSpaceObject): Observable<RemoteData<TDomain>> {
// const postHrefObs = this.getEndpoint();
//
// // TODO ID is unknown at this point
// const idHrefObs = postHrefObs.map((href: string) => this.getFindByIDHref(href, dso.id));
//
// postHrefObs
// .filter((href: string) => hasValue(href))
// .take(1)
// .subscribe((href: string) => {
// const request = new RestRequest(this.requestService.generateRequestId(), href, RestRequestMethod.Post, dso);
// this.requestService.configure(request);
// });
//
// return this.rdbService.buildSingle<TNormalized, TDomain>(idHrefObs, this.normalizedResourceType);
// }
}