Refactor admin actions and improve code formatting: Standardize import statements, enhance error handling messages, and apply consistent formatting across event, user, and preference management functions for better readability and maintainability.
Some checks failed
Deploy with Docker Compose / deploy (push) Has been cancelled
Some checks failed
Deploy with Docker Compose / deploy (push) Has been cancelled
This commit is contained in:
@@ -4,4 +4,3 @@
|
||||
* Tous les services doivent importer depuis ici, pas directement depuis lib/prisma.ts
|
||||
*/
|
||||
export { prisma } from "@/lib/prisma";
|
||||
|
||||
|
||||
@@ -2,14 +2,20 @@
|
||||
* Erreurs métier personnalisées
|
||||
*/
|
||||
export class BusinessError extends Error {
|
||||
constructor(message: string, public code?: string) {
|
||||
constructor(
|
||||
message: string,
|
||||
public code?: string
|
||||
) {
|
||||
super(message);
|
||||
this.name = "BusinessError";
|
||||
}
|
||||
}
|
||||
|
||||
export class ValidationError extends BusinessError {
|
||||
constructor(message: string, public field?: string) {
|
||||
constructor(
|
||||
message: string,
|
||||
public field?: string
|
||||
) {
|
||||
super(message, "VALIDATION_ERROR");
|
||||
this.name = "ValidationError";
|
||||
}
|
||||
@@ -28,4 +34,3 @@ export class ConflictError extends BusinessError {
|
||||
this.name = "ConflictError";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
import { prisma } from "../database";
|
||||
import type {
|
||||
Event,
|
||||
Prisma,
|
||||
} from "@/prisma/generated/prisma/client";
|
||||
import type { Event, Prisma } from "@/prisma/generated/prisma/client";
|
||||
import { EventType } from "@/prisma/generated/prisma/client";
|
||||
import { ValidationError, NotFoundError } from "../errors";
|
||||
import { calculateEventStatus } from "@/lib/eventStatus";
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
import { prisma } from "../database";
|
||||
import type { User, Role, Prisma, CharacterClass } from "@/prisma/generated/prisma/client";
|
||||
import type {
|
||||
User,
|
||||
Role,
|
||||
Prisma,
|
||||
CharacterClass,
|
||||
} from "@/prisma/generated/prisma/client";
|
||||
import { NotFoundError } from "../errors";
|
||||
import { userService } from "./user.service";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user