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