mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-08 02:24:11 +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);
|
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', () => {
|
it('should call findByIdAndIDType with handle params', () => {
|
||||||
@@ -33,7 +33,7 @@ describe('LookupGuard', () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
guard.canActivate(scopedRoute as any, undefined);
|
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', () => {
|
it('should call findByIdAndIDType with UUID params', () => {
|
||||||
|
@@ -35,11 +35,11 @@ export class LookupGuard implements CanActivate {
|
|||||||
type = IdentifierType.HANDLE;
|
type = IdentifierType.HANDLE;
|
||||||
const prefix = route.params.idType;
|
const prefix = route.params.idType;
|
||||||
const handleId = route.params.id;
|
const handleId = route.params.id;
|
||||||
id = `${prefix}/${handleId}`;
|
id = `hdl:${prefix}/${handleId}`;
|
||||||
|
|
||||||
} else if (route.params.idType === IdentifierType.HANDLE) {
|
} else if (route.params.idType === IdentifierType.HANDLE) {
|
||||||
type = IdentifierType.HANDLE;
|
type = IdentifierType.HANDLE;
|
||||||
id = route.params.id;
|
id = 'hdl:' + route.params.id;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
type = IdentifierType.UUID;
|
type = IdentifierType.UUID;
|
||||||
|
Reference in New Issue
Block a user