prisma js
Unanswered
Sun bear posted this in #help-forum
Sun bearOP
export async function POST(request: Request) {
try {
const { content, tags } = await request.json();
const message = await prisma.message.create({
data: {
content,
tags: {
connectOrCreate: tags.map((tag: string) => ({
where: { tagName: tag },
create: { tagName: tag },
})),
},
},
});
pusher.trigger("chat", "message", {
message,
});
return NextResponse.json({ message });
}4 Replies
Sun bearOP
i want to send
tags
with message
but message that is returned doesnt have tags attribute