mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 02:39:33 +02:00
Prefer handle param name
This commit is contained in:
parent
6f68db1be9
commit
e7753c1b62
16 changed files with 63 additions and 80 deletions
|
@ -11,8 +11,8 @@ import { PageHtml } from './page-html.js'
|
|||
import { TagsHtml, TagsOptions } from './tags-html.js'
|
||||
|
||||
export class ActorHtml {
|
||||
static async getAccountHTMLPage (nameWithHost: string, req: express.Request, res: express.Response) {
|
||||
const accountModelPromise = AccountModel.loadByNameWithHost(nameWithHost)
|
||||
static async getAccountHTMLPage (handle: string, req: express.Request, res: express.Response) {
|
||||
const accountModelPromise = AccountModel.loadByHandle(handle)
|
||||
|
||||
return this.getAccountOrChannelHTMLPage({
|
||||
loader: () => accountModelPromise,
|
||||
|
@ -22,8 +22,8 @@ export class ActorHtml {
|
|||
})
|
||||
}
|
||||
|
||||
static async getVideoChannelHTMLPage (nameWithHost: string, req: express.Request, res: express.Response) {
|
||||
const videoChannel = await VideoChannelModel.loadByHandleAndPopulateAccount(nameWithHost)
|
||||
static async getVideoChannelHTMLPage (handle: string, req: express.Request, res: express.Response) {
|
||||
const videoChannel = await VideoChannelModel.loadByHandleAndPopulateAccount(handle)
|
||||
|
||||
return this.getAccountOrChannelHTMLPage({
|
||||
loader: () => Promise.resolve(videoChannel),
|
||||
|
@ -33,10 +33,10 @@ export class ActorHtml {
|
|||
})
|
||||
}
|
||||
|
||||
static async getActorHTMLPage (nameWithHost: string, req: express.Request, res: express.Response) {
|
||||
static async getActorHTMLPage (handle: string, req: express.Request, res: express.Response) {
|
||||
const [ account, channel ] = await Promise.all([
|
||||
AccountModel.loadByNameWithHost(nameWithHost),
|
||||
VideoChannelModel.loadByHandleAndPopulateAccount(nameWithHost)
|
||||
AccountModel.loadByHandle(handle),
|
||||
VideoChannelModel.loadByHandleAndPopulateAccount(handle)
|
||||
])
|
||||
|
||||
return this.getAccountOrChannelHTMLPage({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue