idの混同を修正

This commit is contained in:
kakkokari-gtyih 2023-11-23 17:20:37 +09:00
parent a2ea072deb
commit 6c3d6ba955
5 changed files with 24 additions and 56 deletions

View file

@ -311,7 +311,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
if (renote.channelId && renote.channelId !== ps.channelId) {
// チャンネルのノートに対しリノート要求がきたとき、チャンネル外へのリノート可否をチェック
// リートのユースケースのうち、チャンネル内→チャンネル外は少数だと考えられるため、JOINはせず必要な時に都度取得する
const renoteChannel = await this.channelsRepository.findOneById(renote.channelId);
const renoteChannel = await this.channelsRepository.findOneBy({ id: renote.channelId });
if (renoteChannel == null) {
// リノートしたいノートが書き込まれているチャンネルが無い
throw new ApiError(meta.errors.noSuchChannel);
@ -391,6 +391,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
};
if (ps.schedule) {
// 予約投稿
const canCreateScheduledNote = (await this.roleService.getUserPolicies(me.id)).canScheduleNote;
if (!canCreateScheduledNote) {
throw new ApiError(meta.errors.rolePermissionDenied);
@ -410,7 +411,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
});
const delay = new Date(ps.schedule.scheduledAt).getTime() - Date.now();
await this.queueService.ScheduleNotePostQueue.add(String(delay), {
await this.queueService.ScheduleNotePostQueue.add(delay.toString(), {
scheduledNoteId,
}, {
jobId: scheduledNoteId,