diff --git a/src/app/app.routes.ts b/src/app/app.routes.ts index f710735..4c2ca33 100644 --- a/src/app/app.routes.ts +++ b/src/app/app.routes.ts @@ -3,6 +3,7 @@ import { LoginComponent } from './login/login.component'; import { DashboardComponent } from './dashboard/dashboard.component'; import { AuthGuard } from './service/auth.service'; import { CreateLinkComponent } from './create-link/create-link.component'; +import { ViewLinkComponent } from './view-link/view-link.component'; export const routes: Routes = [ { @@ -19,6 +20,10 @@ export const routes: Routes = [ component: CreateLinkComponent, canActivate: [AuthGuard], }, + { + path: ':link', + component: ViewLinkComponent, + }, { path: "**", redirectTo: "", diff --git a/src/app/service/link.service.ts b/src/app/service/link.service.ts index fcd0537..89b9329 100644 --- a/src/app/service/link.service.ts +++ b/src/app/service/link.service.ts @@ -14,6 +14,10 @@ export class LinkService { return this.pb.collection('links').getFullList(); } + getLink(id: string): Promise { + return this.pb.collection('links').getOne(id); + } + deleteLink(id: string) { this.pb.collection('links').delete(id); } diff --git a/src/app/view-link/view-link.component.css b/src/app/view-link/view-link.component.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/view-link/view-link.component.html b/src/app/view-link/view-link.component.html new file mode 100644 index 0000000..061042f --- /dev/null +++ b/src/app/view-link/view-link.component.html @@ -0,0 +1 @@ +
Your are being redirected.
diff --git a/src/app/view-link/view-link.component.spec.ts b/src/app/view-link/view-link.component.spec.ts new file mode 100644 index 0000000..1d509b7 --- /dev/null +++ b/src/app/view-link/view-link.component.spec.ts @@ -0,0 +1,23 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ViewLinkComponent } from './view-link.component'; + +describe('ViewLinkComponent', () => { + let component: ViewLinkComponent; + let fixture: ComponentFixture