mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-15 14:03:06 +00:00
115427: Fixed delete item not redirecting when having some virtual metadata that needs to be copied
This commit is contained in:
@@ -198,6 +198,11 @@ describe('DeleteDataImpl', () => {
|
|||||||
method: RestRequestMethod.DELETE,
|
method: RestRequestMethod.DELETE,
|
||||||
href: 'some-href?copyVirtualMetadata=a©VirtualMetadata=b©VirtualMetadata=c',
|
href: 'some-href?copyVirtualMetadata=a©VirtualMetadata=b©VirtualMetadata=c',
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
const callback = (rdbService.buildFromRequestUUIDAndAwait as jasmine.Spy).calls.argsFor(0)[1];
|
||||||
|
callback();
|
||||||
|
expect(service.invalidateByHref).toHaveBeenCalledWith('some-href');
|
||||||
|
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -68,15 +68,16 @@ export class DeleteDataImpl<T extends CacheableObject> extends IdentifiableDataS
|
|||||||
deleteByHref(href: string, copyVirtualMetadata?: string[]): Observable<RemoteData<NoContent>> {
|
deleteByHref(href: string, copyVirtualMetadata?: string[]): Observable<RemoteData<NoContent>> {
|
||||||
const requestId = this.requestService.generateRequestId();
|
const requestId = this.requestService.generateRequestId();
|
||||||
|
|
||||||
|
let deleteHref: string = href;
|
||||||
if (copyVirtualMetadata) {
|
if (copyVirtualMetadata) {
|
||||||
copyVirtualMetadata.forEach((id) =>
|
copyVirtualMetadata.forEach((id) =>
|
||||||
href += (href.includes('?') ? '&' : '?')
|
deleteHref += (deleteHref.includes('?') ? '&' : '?')
|
||||||
+ 'copyVirtualMetadata='
|
+ 'copyVirtualMetadata='
|
||||||
+ id,
|
+ id,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const request = new DeleteRequest(requestId, href);
|
const request = new DeleteRequest(requestId, deleteHref);
|
||||||
if (hasValue(this.responseMsToLive)) {
|
if (hasValue(this.responseMsToLive)) {
|
||||||
request.responseMsToLive = this.responseMsToLive;
|
request.responseMsToLive = this.responseMsToLive;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user