feat: add attachment upload with streaming and image validation

This commit is contained in:
2026-11-05 15:05:36 +03:00
parent d960734dae
commit fa0211eecb
20 changed files with 3252 additions and 15 deletions
+19
View File
@@ -0,0 +1,19 @@
import { ApiError } from '../common/filters/api-error';
import { validate as isUuid } from '../common/uuid';
import { PrismaService } from '../db/prisma.service';
export async function assertChatMember(
prisma: PrismaService,
chatId: string,
userId: string,
): Promise<void> {
if (!isUuid(chatId)) {
throw new ApiError('invalid_request', 'chatId must be a valid UUID');
}
const member = await prisma.chatMember.findUnique({
where: { chatId_userId: { chatId, userId } },
});
if (!member) {
throw new ApiError('not_found', 'chat not found');
}
}