1
0
Fork 0
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:
Chocobozzz 2025-04-10 09:55:55 +02:00
parent 6f68db1be9
commit e7753c1b62
No known key found for this signature in database
GPG key ID: 583A612D890159BE
16 changed files with 63 additions and 80 deletions

View file

@ -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({