feat: add /api/messages/images endpoint + ImageGrid fetch

Backend:
- New GET /api/messages/images?guildId=&limit= endpoint
- Queries attachments table for image/* MIME type, returns distinct messages
- Repository uses Drizzle subquery + join pattern

Frontend:
- New get_images() API client function
- ImageGrid fetches from /api/messages/images when Images tab selected
- Separate image_messages signal, fetched on tab switch

Deploy: hot-patched JS/WASM files to running containers
This commit is contained in:
asepharyana
2026-07-05 04:48:29 +07:00
parent e0d6077a65
commit c3b2b3f334
6 changed files with 124 additions and 3 deletions
@@ -46,6 +46,18 @@ export class MessagesService {
return messagesRepository.getAttachmentsByChannel(channelId, query);
}
async getImageMessages(
guildId: string,
limit?: number,
): Promise<ReturnType<typeof messagesRepository.getImageMessages>> {
if (!guildId) {
throw new ValidationError("guildId is required");
}
logger.debug({ guildId, limit }, "Getting image messages");
return messagesRepository.getImageMessages(guildId, limit);
}
async markForReanalysis(id: string): Promise<void> {
if (!id) {
throw new ValidationError("message ID is required");