Skip to content
Snippets Groups Projects
Commit b519b50e authored by OZGCloud's avatar OZGCloud
Browse files

OZG-3034 add types

parent 6d9b8f07
Branches
Tags
No related merge requests found
...@@ -10,7 +10,7 @@ import { ResourceRedirectLinkRel } from './resource-redirect-linkrel'; ...@@ -10,7 +10,7 @@ import { ResourceRedirectLinkRel } from './resource-redirect-linkrel';
@Injectable({ providedIn: 'root' }) @Injectable({ providedIn: 'root' })
export class ResourceRedirectService { export class ResourceRedirectService {
private readonly PARAM_URI_PLACEHOLDER = '{uri}'; private readonly PARAM_URI_PLACEHOLDER: string = '{uri}';
constructor( constructor(
private apiRootService: ApiRootService, private apiRootService: ApiRootService,
...@@ -51,7 +51,7 @@ export class ResourceRedirectService { ...@@ -51,7 +51,7 @@ export class ResourceRedirectService {
navigateToResource(resource: Resource): void { navigateToResource(resource: Resource): void {
if (hasLink(resource, ResourceRedirectLinkRel.VORGANG)) { if (hasLink(resource, ResourceRedirectLinkRel.VORGANG)) {
const vorgangUri: string = toResourceUri(resource, ResourceRedirectLinkRel.VORGANG); const vorgangUri: ResourceUri = toResourceUri(resource, ResourceRedirectLinkRel.VORGANG);
this.navigationService.navigateToVorgang(vorgangUri); this.navigationService.navigateToVorgang(vorgangUri);
return; return;
......
import { ResourceRedirectService } from '@alfa-client/resource-redirect-shared'; import { ResourceRedirectService } from '@alfa-client/resource-redirect-shared';
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router'; import { ActivatedRoute } from '@angular/router';
import { ResourceUri } from '@ngxp/rest';
@Component({ @Component({
standalone: true, standalone: true,
template: '', template: '',
}) })
export class ResourceRedirectComponent implements OnInit { export class ResourceRedirectComponent implements OnInit {
private readonly PARAM_URI = 'uri'; private readonly PARAM_URI: string = 'uri';
constructor( constructor(
private route: ActivatedRoute, private route: ActivatedRoute,
...@@ -16,7 +17,7 @@ export class ResourceRedirectComponent implements OnInit { ...@@ -16,7 +17,7 @@ export class ResourceRedirectComponent implements OnInit {
ngOnInit(): void { ngOnInit(): void {
this.route.queryParamMap.subscribe((queryParams) => { this.route.queryParamMap.subscribe((queryParams) => {
const resourceUri: string = queryParams.get(this.PARAM_URI); const resourceUri: ResourceUri = queryParams.get(this.PARAM_URI);
if (resourceUri) { if (resourceUri) {
this.resourceRedirectService.redirectToResource(resourceUri); this.resourceRedirectService.redirectToResource(resourceUri);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment