expiresAt to scheduledAt
Signed-off-by: mattyatea <mattyacocacora0@gmail.com>
This commit is contained in:
parent
c4a8cf3a73
commit
271c872c97
6 changed files with 29 additions and 18 deletions
|
|
@ -202,7 +202,7 @@ export const paramDef = {
|
|||
type: 'object',
|
||||
nullable: true,
|
||||
properties: {
|
||||
expiresAt: { type: 'integer', nullable: false },
|
||||
scheduledAt: { type: 'integer', nullable: false },
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
@ -388,7 +388,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
throw new ApiError(meta.errors.rolePermissionDenied);
|
||||
}
|
||||
|
||||
if (!ps.schedule.expiresAt) {
|
||||
if (!ps.schedule.scheduledAt) {
|
||||
throw new ApiError(meta.errors.specifyScheduleDate);
|
||||
}
|
||||
|
||||
|
|
@ -398,10 +398,10 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
id: scheduledNoteId,
|
||||
note: note,
|
||||
userId: me.id,
|
||||
expiresAt: new Date(ps.schedule.expiresAt),
|
||||
scheduledAt: new Date(ps.schedule.scheduledAt),
|
||||
});
|
||||
|
||||
const delay = new Date(ps.schedule.expiresAt).getTime() - Date.now();
|
||||
const delay = new Date(ps.schedule.scheduledAt).getTime() - Date.now();
|
||||
await this.queueService.ScheduleNotePostQueue.add(String(delay), {
|
||||
scheduledNoteId,
|
||||
}, {
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ export const meta = {
|
|||
},
|
||||
},
|
||||
userId: { type: 'string', optional: false, nullable: false },
|
||||
expiresAt: { type: 'string', optional: false, nullable: false },
|
||||
scheduledAt: { type: 'string', optional: false, nullable: false },
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
@ -97,14 +97,14 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
isSchedule: boolean;
|
||||
};
|
||||
userId: string;
|
||||
expiresAt: string;
|
||||
scheduledAt: string;
|
||||
}[] = scheduleNotes.map((item: any) => {
|
||||
return {
|
||||
...item,
|
||||
note: {
|
||||
...item.note,
|
||||
user: user,
|
||||
createdAt: new Date(item.expiresAt),
|
||||
createdAt: new Date(item.scheduledAt),
|
||||
isSchedule: true,
|
||||
// ↓TODO: NoteのIDに予約投稿IDを入れたくない(本来別ものなため)
|
||||
id: item.id,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue