mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
77583: Specify id type ~ /api/pid/find?id=hdl:...
This commit is contained in:
@@ -22,7 +22,7 @@ describe('LookupGuard', () => {
|
||||
}
|
||||
};
|
||||
guard.canActivate(scopedRoute as any, undefined);
|
||||
expect(dsoService.findByIdAndIDType).toHaveBeenCalledWith('123456789/1234', IdentifierType.HANDLE);
|
||||
expect(dsoService.findByIdAndIDType).toHaveBeenCalledWith('hdl:123456789/1234', IdentifierType.HANDLE);
|
||||
});
|
||||
|
||||
it('should call findByIdAndIDType with handle params', () => {
|
||||
@@ -33,7 +33,7 @@ describe('LookupGuard', () => {
|
||||
}
|
||||
};
|
||||
guard.canActivate(scopedRoute as any, undefined);
|
||||
expect(dsoService.findByIdAndIDType).toHaveBeenCalledWith('123456789%2F1234', IdentifierType.HANDLE);
|
||||
expect(dsoService.findByIdAndIDType).toHaveBeenCalledWith('hdl:123456789%2F1234', IdentifierType.HANDLE);
|
||||
});
|
||||
|
||||
it('should call findByIdAndIDType with UUID params', () => {
|
||||
|
@@ -35,11 +35,11 @@ export class LookupGuard implements CanActivate {
|
||||
type = IdentifierType.HANDLE;
|
||||
const prefix = route.params.idType;
|
||||
const handleId = route.params.id;
|
||||
id = `${prefix}/${handleId}`;
|
||||
id = `hdl:${prefix}/${handleId}`;
|
||||
|
||||
} else if (route.params.idType === IdentifierType.HANDLE) {
|
||||
type = IdentifierType.HANDLE;
|
||||
id = route.params.id;
|
||||
id = 'hdl:' + route.params.id;
|
||||
|
||||
} else {
|
||||
type = IdentifierType.UUID;
|
||||
|
Reference in New Issue
Block a user