fix: правки

This commit is contained in:
2026-10-10 02:13:35 +03:00
parent 1bef3845bc
commit ff47290919
30 changed files with 902 additions and 183 deletions
+3 -2
View File
@@ -1,5 +1,6 @@
import { BadRequestException, Injectable } from '@nestjs/common';
import { decodeCursor, encodeCursor } from '../common/http/cursor.js';
import type { Page } from '../common/http/page.js';
import type { User } from '../users/user.js';
import { ChatsService } from '../chats/chats.service.js';
import type { CreateMessageDto } from './dto/create-message.dto.js';
@@ -35,7 +36,7 @@ export class MessagesService {
currentUser: User,
limit: number,
cursorValue?: string,
): Promise<{ items: Message[]; next_cursor: string | null }> {
): Promise<Page<Message>> {
await this.chatsService.getForUser(chatId, currentUser);
const scope = `messages:${chatId}`;
const cursor = cursorValue
@@ -70,6 +71,6 @@ export class MessagesService {
};
},
);
return page as { items: Message[]; next_cursor: string | null };
return page as Page<Message>;
}
}