]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/app/+search/shared/channel-lazy-load.resolver.ts
Refactoring margin and padding mixins
[github/Chocobozzz/PeerTube.git] / client / src / app / +search / shared / channel-lazy-load.resolver.ts
CommitLineData
37a44fc9
C
1import { Injectable } from '@angular/core'
2import { Router } from '@angular/router'
3import { VideoChannel } from '@app/shared/shared-main'
4import { SearchService } from '@app/shared/shared-search'
5import { AbstractLazyLoadResolver } from './abstract-lazy-load.resolver'
6
7@Injectable()
8export class ChannelLazyLoadResolver extends AbstractLazyLoadResolver<VideoChannel> {
9
10 constructor (
11 protected router: Router,
12 private searchService: SearchService
13 ) {
14 super()
15 }
16
17 protected finder (url: string) {
18 return this.searchService.searchVideoChannels({ search: url })
19 }
20
21 protected buildUrl (channel: VideoChannel) {
22 return '/video-channels/' + channel.nameWithHost
23 }
24}