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:
@@ -4,6 +4,7 @@ import express from "express";
|
||||
import { asyncHandler } from "../../shared/middlewares/index.js";
|
||||
import {
|
||||
handleGetAttachmentsByChannel,
|
||||
handleGetImageMessages,
|
||||
handleGetMessageById,
|
||||
handleGetMessagesByChannel,
|
||||
handleListMessages,
|
||||
@@ -31,6 +32,11 @@ const reanalyzeBatchInFlight = new Set<string>();
|
||||
export function createMessagesRouter(): Router {
|
||||
const router = express.Router();
|
||||
|
||||
// GET /api/messages/images - Get messages with image attachments
|
||||
// MUST be registered BEFORE /messages/:channelId so "images" is not
|
||||
// captured as a channelId param.
|
||||
router.get("/messages/images", handleGetImageMessages);
|
||||
|
||||
// GET /api/messages - List messages
|
||||
router.get("/messages", handleListMessages);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user