diff options
| author | syuilo <4439005+syuilo@users.noreply.github.com> | 2025-06-28 20:21:21 +0900 |
|---|---|---|
| committer | syuilo <4439005+syuilo@users.noreply.github.com> | 2025-06-28 20:21:21 +0900 |
| commit | b8e8f3ad25fafbe0567e710eddfcced04deb03ad (patch) | |
| tree | 4847b140ad2a7b5c5c86e5cda61af2ff7e444853 /packages/backend/src/server/api/endpoints/drive/files | |
| parent | enhance(frontend): improve MkTl rendering (diff) | |
| download | misskey-b8e8f3ad25fafbe0567e710eddfcced04deb03ad.tar.gz misskey-b8e8f3ad25fafbe0567e710eddfcced04deb03ad.tar.bz2 misskey-b8e8f3ad25fafbe0567e710eddfcced04deb03ad.zip | |
enhance: ページネーション(一覧表示)の基準日時を指定できるように sinceId/untilIdが指定可能なエンドポイントにおいて、sinceDate/untilDateも指定可能に
Diffstat (limited to 'packages/backend/src/server/api/endpoints/drive/files')
| -rw-r--r-- | packages/backend/src/server/api/endpoints/drive/files/attached-notes.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/packages/backend/src/server/api/endpoints/drive/files/attached-notes.ts b/packages/backend/src/server/api/endpoints/drive/files/attached-notes.ts index b86059b5e7..6bc8730a1e 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/attached-notes.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/attached-notes.ts @@ -9,8 +9,8 @@ import type { NotesRepository, DriveFilesRepository } from '@/models/_.js'; import { QueryService } from '@/core/QueryService.js'; import { NoteEntityService } from '@/core/entities/NoteEntityService.js'; import { DI } from '@/di-symbols.js'; -import { ApiError } from '../../../error.js'; import { RoleService } from '@/core/RoleService.js'; +import { ApiError } from '../../../error.js'; export const meta = { tags: ['drive', 'notes'], @@ -45,6 +45,8 @@ export const paramDef = { properties: { sinceId: { type: 'string', format: 'misskey:id' }, untilId: { type: 'string', format: 'misskey:id' }, + sinceDate: { type: 'integer' }, + untilDate: { type: 'integer' }, limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 }, fileId: { type: 'string', format: 'misskey:id' }, }, @@ -75,7 +77,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint- throw new ApiError(meta.errors.noSuchFile); } - const query = this.queryService.makePaginationQuery(this.notesRepository.createQueryBuilder('note'), ps.sinceId, ps.untilId); + const query = this.queryService.makePaginationQuery(this.notesRepository.createQueryBuilder('note'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate); query.andWhere(':file <@ note.fileIds', { file: [file.id] }); const notes = await query.limit(ps.limit).getMany(); |