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:
@@ -23,8 +23,8 @@ import { HealthController } from "./health.controller";
|
||||
import { MailModule } from "./mail/mail.module";
|
||||
import { MediaModule } from "./media/media.module";
|
||||
import { MessagesModule } from "./messages/messages.module";
|
||||
import { ReportsModule } from "./reports/reports.module";
|
||||
import { RealtimeModule } from "./realtime/realtime.module";
|
||||
import { ReportsModule } from "./reports/reports.module";
|
||||
import { S3Module } from "./s3/s3.module";
|
||||
import { SessionsModule } from "./sessions/sessions.module";
|
||||
import { TagsModule } from "./tags/tags.module";
|
||||
|
||||
@@ -3,8 +3,8 @@ import {
|
||||
Injectable,
|
||||
NotFoundException,
|
||||
} from "@nestjs/common";
|
||||
import { CommentsRepository } from "./repositories/comments.repository";
|
||||
import type { CreateCommentDto } from "./dto/create-comment.dto";
|
||||
import { CommentsRepository } from "./repositories/comments.repository";
|
||||
|
||||
@Injectable()
|
||||
export class CommentsService {
|
||||
|
||||
@@ -4,10 +4,10 @@ export * from "./categories";
|
||||
export * from "./comments";
|
||||
export * from "./content";
|
||||
export * from "./favorites";
|
||||
export * from "./messages";
|
||||
export * from "./pgp";
|
||||
export * from "./rbac";
|
||||
export * from "./reports";
|
||||
export * from "./messages";
|
||||
export * from "./sessions";
|
||||
export * from "./tags";
|
||||
export * from "./users";
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ export class EventsGateway
|
||||
|
||||
const payload = await this.jwtService.verifyJwt(session.accessToken);
|
||||
client.data.user = payload;
|
||||
|
||||
|
||||
// Rejoindre une room personnelle pour les notifications
|
||||
client.join(`user:${payload.sub}`);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user