mirror of
https://github.com/linkwarden/linkwarden.git
synced 2026-07-01 08:16:26 +00:00
19 lines
416 B
TypeScript
19 lines
416 B
TypeScript
import { prisma } from "@linkwarden/prisma";
|
|
|
|
export default async function deleteHighlightById(
|
|
userId: number,
|
|
highlightId: number
|
|
) {
|
|
if (!highlightId)
|
|
return { response: "Please choose a valid highlight.", status: 401 };
|
|
|
|
const targetHighlight = await prisma.highlight.delete({
|
|
where: {
|
|
id: highlightId,
|
|
userId,
|
|
},
|
|
});
|
|
|
|
return { response: targetHighlight.id, status: 200 };
|
|
}
|