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