refactor: improve import order and code formatting

- Reordered and grouped imports consistently in backend and frontend files for better readability.
- Applied indentation and formatting fixes across frontend components, services, and backend modules.
- Adjusted multiline method calls and type definitions for improved clarity.
This commit is contained in:
Mathis HERRIOT
2026-01-29 14:44:34 +01:00
parent 27f8c7148a
commit 9db3067721
12 changed files with 60 additions and 58 deletions

View File

@@ -31,10 +31,7 @@ export class MessagesController {
}
@Post()
sendMessage(
@Req() req: AuthenticatedRequest,
@Body() dto: CreateMessageDto,
) {
sendMessage(@Req() req: AuthenticatedRequest, @Body() dto: CreateMessageDto) {
return this.messagesService.sendMessage(req.user.sub, dto);
}
}

View File

@@ -1,8 +1,4 @@
import {
ForbiddenException,
Injectable,
NotFoundException,
} from "@nestjs/common";
import { ForbiddenException, Injectable } from "@nestjs/common";
import { EventsGateway } from "../realtime/events.gateway";
import type { CreateMessageDto } from "./dto/create-message.dto";
import { MessagesRepository } from "./repositories/messages.repository";

View File

@@ -20,9 +20,7 @@ export class MessagesRepository {
conversationParticipants,
eq(conversations.id, conversationParticipants.conversationId),
)
.where(
inArray(conversationParticipants.userId, [userId1, userId2])
)
.where(inArray(conversationParticipants.userId, [userId1, userId2]))
.groupBy(conversations.id)
.having(sql`count(${conversations.id}) = 2`);
@@ -90,16 +88,13 @@ export class MessagesRepository {
eq(conversations.id, conversationParticipants.conversationId),
)
.innerJoin(users, eq(conversationParticipants.userId, users.uuid))
.leftJoin(
messages,
eq(conversations.id, messages.conversationId)
)
.leftJoin(messages, eq(conversations.id, messages.conversationId))
.where(
and(
inArray(conversations.id, userConvs),
eq(conversationParticipants.userId, users.uuid),
sql`${users.uuid} != ${userId}`
)
sql`${users.uuid} != ${userId}`,
),
)
.orderBy(desc(conversations.updatedAt));
}