Fixed 267U.pre2

This commit is contained in:
2026-07-26 18:25:37 +09:00
parent 50bfaeafdf
commit 317d00a284
1286 changed files with 80222 additions and 1 deletions
@@ -0,0 +1,23 @@
import { Notes } from "../models/index.js";
export async function countSameRenotes(userId, renoteId, excludeNoteId, groupId) {
// 指定したユーザーの指定したノートのリノートがいくつあるか数える
const query = Notes.createQueryBuilder("note").where("note.userId = :userId", {
userId
}).andWhere("note.renoteId = :renoteId", {
renoteId
});
if (groupId) {
query.andWhere("note.groupId = :groupId", {
groupId
});
} else {
query.andWhere("note.groupId IS NULL");
}
// 指定した投稿を除く
if (excludeNoteId) {
query.andWhere("note.id != :excludeNoteId", {
excludeNoteId
});
}
return await query.getCount();
}