pass "me" in a few places that lack it
This commit is contained in:
parent
7f547a8c10
commit
2e61fafe57
8 changed files with 9 additions and 9 deletions
|
|
@ -70,7 +70,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
secret: secret,
|
||||
});
|
||||
|
||||
return await this.appEntityService.pack(app, null, {
|
||||
return await this.appEntityService.pack(app, me, {
|
||||
detail: true,
|
||||
includeSecret: true,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
|
||||
private userEntityService: UserEntityService,
|
||||
) {
|
||||
super(meta, paramDef, async (ps) => {
|
||||
super(meta, paramDef, async (ps, me) => {
|
||||
const records = await this.bubbleGameRecordsRepository.find({
|
||||
where: {
|
||||
gameMode: ps.gameMode,
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
throw new ApiError(meta.errors.noSuchRoom);
|
||||
}
|
||||
|
||||
if (!await this.chatService.hasPermissionToViewRoomTimeline(me.id, room)) {
|
||||
if (!await this.chatService.hasPermissionToViewRoomTimeline(me, room)) {
|
||||
throw new ApiError(meta.errors.noSuchRoom);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
throw new ApiError(meta.errors.noSuchRoom);
|
||||
}
|
||||
|
||||
if (!await this.chatService.hasPermissionToDeleteRoom(me.id, room)) {
|
||||
if (!await this.chatService.hasPermissionToDeleteRoom(me, room)) {
|
||||
throw new ApiError(meta.errors.noSuchRoom);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
private activeUsersChart: ActiveUsersChart,
|
||||
) {
|
||||
super(meta, paramDef, async (ps, me) => {
|
||||
const policies = await this.roleService.getUserPolicies(me ? me.id : null);
|
||||
const policies = await this.roleService.getUserPolicies(me);
|
||||
if (!policies.btlAvailable) {
|
||||
throw new ApiError(meta.errors.btlDisabled);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,9 +69,9 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
// TODO inline this into the above query
|
||||
for (const note of renotes) {
|
||||
if (ps.quote) {
|
||||
if (note.text) this.noteDeleteService.delete(await this.usersRepository.findOneByOrFail({ id: me.id }), note, false);
|
||||
if (note.text) this.noteDeleteService.delete(me, note, false);
|
||||
} else {
|
||||
if (!note.text) this.noteDeleteService.delete(await this.usersRepository.findOneByOrFail({ id: me.id }), note, false);
|
||||
if (!note.text) this.noteDeleteService.delete(me, note, false);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
const currentCount = await this.userListsRepository.countBy({
|
||||
userId: me.id,
|
||||
});
|
||||
if (currentCount >= (await this.roleService.getUserPolicies(me.id)).userListLimit) {
|
||||
if (currentCount >= (await this.roleService.getUserPolicies(me)).userListLimit) {
|
||||
throw new ApiError(meta.errors.tooManyUserLists);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue