mirror of
https://github.com/BreizhHardware/Site-comptage-heure.git
synced 2026-03-18 21:30:40 +01:00
fix: update import paths for components and utilities to relative paths
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import NextAuth from 'next-auth';
|
||||
import { authOptions } from '@/lib/auth';
|
||||
import { authOptions } from '../../../../lib/auth'
|
||||
|
||||
const handler = NextAuth(authOptions);
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { NextRequest, NextResponse } from 'next/server';
|
||||
import { getServerSession } from 'next-auth';
|
||||
import { authOptions } from '@/lib/auth';
|
||||
import { prisma } from '@/lib/prisma';
|
||||
import { authOptions } from '../../../../lib/auth';
|
||||
import { prisma } from '../../../../lib/prisma';
|
||||
import bcrypt from 'bcryptjs';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { NextRequest, NextResponse } from 'next/server';
|
||||
import { getServerSession } from 'next-auth';
|
||||
import { authOptions } from '@/lib/auth';
|
||||
import { prisma } from '@/lib/prisma';
|
||||
import { authOptions } from '../../../lib/auth';
|
||||
import { prisma } from '../../../lib/prisma';
|
||||
import * as csvWriter from 'csv-writer';
|
||||
import ExcelJS from 'exceljs';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { NextRequest, NextResponse } from 'next/server';
|
||||
import { getServerSession } from 'next-auth';
|
||||
import { authOptions } from '@/lib/auth';
|
||||
import { prisma } from '@/lib/prisma';
|
||||
import { authOptions } from '../../../../lib/auth';
|
||||
import { prisma } from '../../../../lib/prisma';
|
||||
|
||||
export async function PUT(
|
||||
request: NextRequest,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { NextRequest, NextResponse } from 'next/server';
|
||||
import { getServerSession } from 'next-auth';
|
||||
import { authOptions } from '@/lib/auth';
|
||||
import { prisma } from '@/lib/prisma';
|
||||
import { authOptions } from '../../../lib/auth';
|
||||
import { prisma } from '../../../lib/prisma';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
|
||||
export async function GET() {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { NextRequest, NextResponse } from 'next/server';
|
||||
import { getServerSession } from 'next-auth';
|
||||
import { authOptions } from '@/lib/auth';
|
||||
import { prisma } from '@/lib/prisma';
|
||||
import { authOptions } from '../../../lib/auth';
|
||||
import { prisma } from '../../../lib/prisma';
|
||||
|
||||
export async function GET() {
|
||||
const settings = await prisma.clubSettings.findFirst();
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
import { NextRequest, NextResponse } from 'next/server';
|
||||
import { getServerSession } from 'next-auth';
|
||||
import { authOptions } from '@/lib/auth';
|
||||
import { prisma } from '@/lib/prisma';
|
||||
import { authOptions } from '../../../../lib/auth';
|
||||
import { prisma } from '../../../../lib/prisma';
|
||||
|
||||
export async function DELETE(
|
||||
request: NextRequest,
|
||||
{ params }: { params: { id: string } },
|
||||
{ params }: { params: Promise<{ id: string }> },
|
||||
) {
|
||||
const session = await getServerSession(authOptions);
|
||||
if (!session || session.user.role !== 'SUPER_ADMIN') {
|
||||
return NextResponse.json({ error: 'Accès refusé' }, { status: 403 });
|
||||
}
|
||||
|
||||
const userId = params.id;
|
||||
const { id } = await params;
|
||||
|
||||
const user = await prisma.user.findUnique({
|
||||
where: { id: userId },
|
||||
where: { id },
|
||||
include: { hours: true },
|
||||
});
|
||||
|
||||
@@ -34,7 +34,7 @@ export async function DELETE(
|
||||
}
|
||||
|
||||
await prisma.user.delete({
|
||||
where: { id: userId },
|
||||
where: { id },
|
||||
});
|
||||
|
||||
return NextResponse.json({ message: 'Utilisateur supprimé' });
|
||||
|
||||
Reference in New Issue
Block a user