pass "me" in a few places that lack it

This commit is contained in:
Hazelnoot 2025-06-22 15:34:37 -04:00
parent 7f547a8c10
commit 2e61fafe57
8 changed files with 9 additions and 9 deletions

View file

@ -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,
});

View file

@ -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,

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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);
}
}
});

View file

@ -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);
}