Retrieve user by id instead of username
This commit is contained in:
parent
f8be7bae3f
commit
1acb947504
3 changed files with 4 additions and 9 deletions
|
@ -106,10 +106,5 @@ export abstract class UserEdit extends FormReactive implements OnInit {
|
||||||
label: q.label,
|
label: q.label,
|
||||||
disabled: q.disabled
|
disabled: q.disabled
|
||||||
}))
|
}))
|
||||||
|
|
||||||
console.log(
|
|
||||||
this.videoQuotaOptions,
|
|
||||||
this.videoQuotaDailyOptions
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -130,7 +130,7 @@ async function getUserVideoImports (req: express.Request, res: express.Response)
|
||||||
|
|
||||||
async function getUserInformation (req: express.Request, res: express.Response) {
|
async function getUserInformation (req: express.Request, res: express.Response) {
|
||||||
// We did not load channels in res.locals.user
|
// We did not load channels in res.locals.user
|
||||||
const user = await UserModel.loadForMeAPI(res.locals.oauth.token.user.username)
|
const user = await UserModel.loadForMeAPI(res.locals.oauth.token.user.id)
|
||||||
|
|
||||||
return res.json(user.toMeFormattedJSON())
|
return res.json(user.toMeFormattedJSON())
|
||||||
}
|
}
|
||||||
|
|
|
@ -564,17 +564,17 @@ export class UserModel extends Model {
|
||||||
static loadByUsername (username: string): Promise<MUserDefault> {
|
static loadByUsername (username: string): Promise<MUserDefault> {
|
||||||
const query = {
|
const query = {
|
||||||
where: {
|
where: {
|
||||||
username: { [Op.iLike]: username }
|
username
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return UserModel.findOne(query)
|
return UserModel.findOne(query)
|
||||||
}
|
}
|
||||||
|
|
||||||
static loadForMeAPI (username: string): Promise<MUserNotifSettingChannelDefault> {
|
static loadForMeAPI (id: number): Promise<MUserNotifSettingChannelDefault> {
|
||||||
const query = {
|
const query = {
|
||||||
where: {
|
where: {
|
||||||
username: { [Op.iLike]: username }
|
id
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue