PeerTube/client/src/app/+search/shared/channel-lazy-load.resolver.ts
Chocobozzz 338633ce72
Remove barrels
They can prevent tree shaking
2024-03-05 10:52:32 +01:00

25 lines
744 B
TypeScript

import { Injectable } from '@angular/core'
import { Router } from '@angular/router'
import { AbstractLazyLoadResolver } from './abstract-lazy-load.resolver'
import { VideoChannel } from '@app/shared/shared-main/video-channel/video-channel.model'
import { SearchService } from '@app/shared/shared-search/search.service'
@Injectable()
export class ChannelLazyLoadResolver extends AbstractLazyLoadResolver<VideoChannel> {
constructor (
protected router: Router,
private searchService: SearchService
) {
super()
}
protected finder (url: string) {
return this.searchService.searchVideoChannels({ search: url })
}
protected buildUrl (channel: VideoChannel) {
return '/video-channels/' + channel.nameWithHost
}
}