idのとこにscheduledAtから生成したidを入れた

Signed-off-by: mattyatea <mattyacocacora0@gmail.com>
This commit is contained in:
mattyatea 2023-11-14 18:48:13 +09:00
parent 380c8c3283
commit 29e2f886aa
No known key found for this signature in database
GPG Key ID: 068E54E2C33BEF9A
1 changed files with 3 additions and 1 deletions

View File

@ -10,6 +10,7 @@ import { DI } from '@/di-symbols.js';
import type { ScheduledNotesRepository } from '@/models/_.js';
import { UserEntityService } from '@/core/entities/UserEntityService.js';
import { QueryService } from '@/core/QueryService.js';
import { IdService } from '@/core/IdService.js';
export const meta = {
tags: ['notes'],
@ -73,6 +74,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
@Inject(DI.scheduledNotesRepository)
private scheduledNotesRepository: ScheduledNotesRepository,
private idService: IdService,
private userEntityService: UserEntityService,
private queryService: QueryService,
) {
@ -107,7 +109,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
createdAt: new Date(item.scheduledAt),
isSchedule: true,
// ↓TODO: NoteのIDに予約投稿IDを入れたくない本来別ものなため
id: item.id,
id: this.idService.gen(item.scheduledAt.getTime()),
},
};
});