summaryrefslogtreecommitdiff
path: root/packages/backend/src/server/api/endpoints/notes
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2023-10-09 13:32:41 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2023-10-09 13:32:41 +0900
commit4f20c871860d0f62aef77bc716c3cc2677d4a592 (patch)
treef819d92c3e3eb413b4e9826d4360b21bfe9c5215 /packages/backend/src/server/api/endpoints/notes
parentrefactor(backend): better argument name (diff)
downloadsharkey-4f20c871860d0f62aef77bc716c3cc2677d4a592.tar.gz
sharkey-4f20c871860d0f62aef77bc716c3cc2677d4a592.tar.bz2
sharkey-4f20c871860d0f62aef77bc716c3cc2677d4a592.zip
lint fixes
Diffstat (limited to 'packages/backend/src/server/api/endpoints/notes')
-rw-r--r--packages/backend/src/server/api/endpoints/notes/children.ts21
-rw-r--r--packages/backend/src/server/api/endpoints/notes/mentions.ts7
-rw-r--r--packages/backend/src/server/api/endpoints/notes/polls/recommendation.ts7
3 files changed, 20 insertions, 15 deletions
diff --git a/packages/backend/src/server/api/endpoints/notes/children.ts b/packages/backend/src/server/api/endpoints/notes/children.ts
index 1a82a4b5d7..1e569d9806 100644
--- a/packages/backend/src/server/api/endpoints/notes/children.ts
+++ b/packages/backend/src/server/api/endpoints/notes/children.ts
@@ -49,16 +49,19 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
) {
super(meta, paramDef, async (ps, me) => {
const query = this.queryService.makePaginationQuery(this.notesRepository.createQueryBuilder('note'), ps.sinceId, ps.untilId)
- .andWhere(new Brackets(qb => { qb
- .where('note.replyId = :noteId', { noteId: ps.noteId })
- .orWhere(new Brackets(qb => { qb
- .where('note.renoteId = :noteId', { noteId: ps.noteId })
- .andWhere(new Brackets(qb => { qb
- .where('note.text IS NOT NULL')
- .orWhere('note.fileIds != \'{}\'')
- .orWhere('note.hasPoll = TRUE');
+ .andWhere(new Brackets(qb => {
+ qb
+ .where('note.replyId = :noteId', { noteId: ps.noteId })
+ .orWhere(new Brackets(qb => {
+ qb
+ .where('note.renoteId = :noteId', { noteId: ps.noteId })
+ .andWhere(new Brackets(qb => {
+ qb
+ .where('note.text IS NOT NULL')
+ .orWhere('note.fileIds != \'{}\'')
+ .orWhere('note.hasPoll = TRUE');
+ }));
}));
- }));
}))
.innerJoinAndSelect('note.user', 'user')
.leftJoinAndSelect('note.reply', 'reply')
diff --git a/packages/backend/src/server/api/endpoints/notes/mentions.ts b/packages/backend/src/server/api/endpoints/notes/mentions.ts
index 65e7bd8cd5..6fab024d17 100644
--- a/packages/backend/src/server/api/endpoints/notes/mentions.ts
+++ b/packages/backend/src/server/api/endpoints/notes/mentions.ts
@@ -59,9 +59,10 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
.where('following.followerId = :followerId', { followerId: me.id });
const query = this.queryService.makePaginationQuery(this.notesRepository.createQueryBuilder('note'), ps.sinceId, ps.untilId)
- .andWhere(new Brackets(qb => { qb
- .where(`'{"${me.id}"}' <@ note.mentions`)
- .orWhere(`'{"${me.id}"}' <@ note.visibleUserIds`);
+ .andWhere(new Brackets(qb => {
+ qb
+ .where(`'{"${me.id}"}' <@ note.mentions`)
+ .orWhere(`'{"${me.id}"}' <@ note.visibleUserIds`);
}))
// Avoid scanning primary key index
.orderBy('CONCAT(note.id)', 'DESC')
diff --git a/packages/backend/src/server/api/endpoints/notes/polls/recommendation.ts b/packages/backend/src/server/api/endpoints/notes/polls/recommendation.ts
index 29190af62a..986201e950 100644
--- a/packages/backend/src/server/api/endpoints/notes/polls/recommendation.ts
+++ b/packages/backend/src/server/api/endpoints/notes/polls/recommendation.ts
@@ -57,9 +57,10 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
.where('poll.userHost IS NULL')
.andWhere('poll.userId != :meId', { meId: me.id })
.andWhere('poll.noteVisibility = \'public\'')
- .andWhere(new Brackets(qb => { qb
- .where('poll.expiresAt IS NULL')
- .orWhere('poll.expiresAt > :now', { now: new Date() });
+ .andWhere(new Brackets(qb => {
+ qb
+ .where('poll.expiresAt IS NULL')
+ .orWhere('poll.expiresAt > :now', { now: new Date() });
}));
//#region exclude arleady voted polls