summaryrefslogtreecommitdiff
path: root/packages/backend/src/core/PollService.ts
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2022-12-04 15:03:09 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2022-12-04 15:03:09 +0900
commitbbb49457f9fb5d46402e913c92ebf77722cad6ff (patch)
tree8ef285bcbab2c3a4a89d0a624a802d76a2864fed /packages/backend/src/core/PollService.ts
parent:art: (diff)
downloadmisskey-bbb49457f9fb5d46402e913c92ebf77722cad6ff.tar.gz
misskey-bbb49457f9fb5d46402e913c92ebf77722cad6ff.tar.bz2
misskey-bbb49457f9fb5d46402e913c92ebf77722cad6ff.zip
refactor: introduce bindThis decorator to bind this automaticaly
Diffstat (limited to 'packages/backend/src/core/PollService.ts')
-rw-r--r--packages/backend/src/core/PollService.ts3
1 files changed, 3 insertions, 0 deletions
diff --git a/packages/backend/src/core/PollService.ts b/packages/backend/src/core/PollService.ts
index 287ce8ada4..3cc9b0cc9b 100644
--- a/packages/backend/src/core/PollService.ts
+++ b/packages/backend/src/core/PollService.ts
@@ -11,6 +11,7 @@ import { CreateNotificationService } from '@/core/CreateNotificationService.js';
import { ApRendererService } from '@/core/activitypub/ApRendererService.js';
import { UserEntityService } from '@/core/entities/UserEntityService.js';
import { ApDeliverManagerService } from '@/core/activitypub/ApDeliverManagerService.js';
+import { bindThis } from '@/decorators.js';
@Injectable()
export class PollService {
@@ -40,6 +41,7 @@ export class PollService {
) {
}
+ @bindThis
public async vote(user: CacheableUser, note: Note, choice: number) {
const poll = await this.pollsRepository.findOneBy({ noteId: note.id });
@@ -99,6 +101,7 @@ export class PollService {
});
}
+ @bindThis
public async deliverQuestionUpdate(noteId: Note['id']) {
const note = await this.notesRepository.findOneBy({ id: noteId });
if (note == null) throw new Error('note not found');