calendar 32
This commit is contained in:
parent
75e6385ace
commit
fefff8a8ee
@ -144,7 +144,7 @@ export async function DELETE(
|
||||
) {
|
||||
const session = await getServerSession(authOptions);
|
||||
|
||||
if (!session?.user?.username) {
|
||||
if (!session?.user?.id) {
|
||||
return NextResponse.json({ error: "Non authentifié" }, { status: 401 });
|
||||
}
|
||||
|
||||
@ -153,7 +153,7 @@ export async function DELETE(
|
||||
const calendar = await prisma.calendar.findFirst({
|
||||
where: {
|
||||
id: params.id,
|
||||
userId: session.user.username,
|
||||
userId: session.user.id,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user