NoteSchedule -> ScheduledNote
This commit is contained in:
parent
54fa83f1c5
commit
a0e9ebfb83
11 changed files with 33 additions and 33 deletions
|
|
@ -16,7 +16,7 @@ import type {
|
|||
BlockingsRepository,
|
||||
DriveFilesRepository,
|
||||
ChannelsRepository,
|
||||
NoteScheduleRepository,
|
||||
ScheduledNotesRepository,
|
||||
} from '@/models/_.js';
|
||||
import type { MiNoteCreateOption } from '@/types.js';
|
||||
import { MAX_NOTE_TEXT_LENGTH } from '@/const.js';
|
||||
|
|
@ -205,8 +205,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
@Inject(DI.notesRepository)
|
||||
private notesRepository: NotesRepository,
|
||||
|
||||
@Inject(DI.noteScheduleRepository)
|
||||
private noteScheduleRepository: NoteScheduleRepository,
|
||||
@Inject(DI.scheduledNotesRepository)
|
||||
private scheduledNotesRepository: ScheduledNotesRepository,
|
||||
|
||||
@Inject(DI.blockingsRepository)
|
||||
private blockingsRepository: BlockingsRepository,
|
||||
|
|
@ -366,7 +366,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
if (ps.schedule && ps.schedule.expiresAt) {
|
||||
me.token = null;
|
||||
const scheduleNoteId = this.idService.gen(new Date().getTime());
|
||||
await this.noteScheduleRepository.insert({
|
||||
await this.scheduledNotesRepository.insert({
|
||||
id: scheduleNoteId,
|
||||
note: note,
|
||||
userId: me.id,
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
import ms from 'ms';
|
||||
import { Inject, Injectable } from '@nestjs/common';
|
||||
import type { NoteScheduleRepository } from '@/models/_.js';
|
||||
import type { ScheduledNotesRepository } from '@/models/_.js';
|
||||
import { Endpoint } from '@/server/api/endpoint-base.js';
|
||||
import { DI } from '@/di-symbols.js';
|
||||
|
||||
|
|
@ -39,11 +39,11 @@ export const paramDef = {
|
|||
@Injectable()
|
||||
export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-disable-line import/no-default-export
|
||||
constructor(
|
||||
@Inject(DI.noteScheduleRepository)
|
||||
private noteScheduleRepository: NoteScheduleRepository,
|
||||
@Inject(DI.scheduledNotesRepository)
|
||||
private scheduledNotesRepository: ScheduledNotesRepository,
|
||||
) {
|
||||
super(meta, paramDef, async (ps, me) => {
|
||||
await this.noteScheduleRepository.delete({ id: ps.noteId });
|
||||
await this.scheduledNotesRepository.delete({ id: ps.noteId });
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import ms from 'ms';
|
|||
import { Inject, Injectable } from '@nestjs/common';
|
||||
import { Endpoint } from '@/server/api/endpoint-base.js';
|
||||
import { DI } from '@/di-symbols.js';
|
||||
import type { NoteScheduleRepository } from '@/models/_.js';
|
||||
import type { ScheduledNotesRepository } from '@/models/_.js';
|
||||
import { UserEntityService } from '@/core/entities/UserEntityService.js';
|
||||
|
||||
export const meta = {
|
||||
|
|
@ -62,12 +62,12 @@ export const paramDef = {
|
|||
@Injectable()
|
||||
export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-disable-line import/no-default-export
|
||||
constructor(
|
||||
@Inject(DI.noteScheduleRepository)
|
||||
private noteScheduleRepository: NoteScheduleRepository,
|
||||
@Inject(DI.scheduledNotesRepository)
|
||||
private scheduledNotesRepository: ScheduledNotesRepository,
|
||||
private userEntityService: UserEntityService,
|
||||
) {
|
||||
super(meta, paramDef, async (ps, me) => {
|
||||
const scheduleNotes = await this.noteScheduleRepository.findBy({ userId: me.id });
|
||||
const scheduleNotes = await this.scheduledNotesRepository.findBy({ userId: me.id });
|
||||
const user = await this.userEntityService.pack(me, me);
|
||||
const scheduleNotesPack: {
|
||||
id: string;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue