Now navigates to tool landing page with id

This commit is contained in:
jbalasis 2024-06-25 16:10:28 +03:00
parent edbf448510
commit d649189c9a
5 changed files with 6 additions and 5 deletions

1
package-lock.json generated
View File

@ -5,6 +5,7 @@
"requires": true,
"packages": {
"": {
"name": "scilake-catalogue-ui",
"version": "0.0.0",
"dependencies": {
"@angular/animations": "^16.2.12",

View File

@ -65,7 +65,7 @@ const dataSpaceRoutes: Routes = [
component: BrowseJobsComponent
},
{
path: 'landingPage/:resourceType/:identifierValue',
path: 'landingPage/:resourceType/:id',
component: PayloadComponent
},
{

View File

@ -45,7 +45,7 @@ export class PayloadComponent implements OnInit{
ngOnInit() {
this.route.params.subscribe(params => {
this.resourceType = params['resourceType'];
this.resourcePayloadService.getItem(params['resourceType'], params['identifierValue']).subscribe(
this.resourcePayloadService.getItem(params['resourceType'], params['id']).subscribe(
next => {this.payload = next;},
error => {console.log(error);},
() => {

View File

@ -67,7 +67,7 @@
<ng-container *ngFor="let result of payload.results; let i = index">
<a [routerLink]="['/landingPage', resourceType, result.identifier.value]" class="serviceDetails">
<a [routerLink]="['/landingPage', resourceType, result.id]" class="serviceDetails">
<div class="uk-card uk-card-default uk-card-hover uk-margin-bottom">
<!--LAPTOP & PAD LANDSCAPE-->

View File

@ -44,8 +44,8 @@ export class ResourcePayloadService {
return this.http.get<Paging<any>>(this.base + `/items?resourceType=${resourceType}`, {params: params});
}
getItem(resourceType: string, identifierValue: string) {
return this.http.get(this.base + `/items/search?resourceType=${resourceType}&field=identifier&value=${identifierValue}`);
getItem(resourceType: string, id: string) {
return this.http.get(this.base + `/items/${id}?resourceType=${resourceType}`);
}
getItemById(resourceType: string, id: string) {