add new note search file types (module, flash) and optimize file type query

This commit is contained in:
Hazelnoot 2025-02-13 09:28:46 -05:00
parent 5276d6024d
commit ed981a6970
8 changed files with 135 additions and 59 deletions

View file

@ -5,7 +5,7 @@
import { Injectable } from '@nestjs/common';
import { Endpoint } from '@/server/api/endpoint-base.js';
import { SearchService } from '@/core/SearchService.js';
import { fileTypeCategories, SearchService } from '@/core/SearchService.js';
import { NoteEntityService } from '@/core/entities/NoteEntityService.js';
import { RoleService } from '@/core/RoleService.js';
import { ApiError } from '../../error.js';
@ -52,7 +52,11 @@ export const paramDef = {
type: 'string',
description: 'The local host is represented with `.`.',
},
filetype: { type: 'string', nullable: true },
filetype: {
type: 'string',
nullable: true,
enum: fileTypeCategories,
},
userId: { type: 'string', format: 'misskey:id', nullable: true, default: null },
channelId: { type: 'string', format: 'misskey:id', nullable: true, default: null },
order: { type: 'string' },