# Forum Created
## feat - CRUD Forum - CRD Koment - Tampilan forum profile ### No issue
This commit is contained in:
22
src/app_modules/forum/fun/edit/fun_edit_posting_by_id.ts
Normal file
22
src/app_modules/forum/fun/edit/fun_edit_posting_by_id.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { revalidatePath } from "next/cache";
|
||||
|
||||
export async function forum_funEditPostingById(
|
||||
postingId: string,
|
||||
diskusi: string
|
||||
) {
|
||||
const updt = await prisma.forum_Posting.update({
|
||||
where: {
|
||||
id: postingId,
|
||||
},
|
||||
data: {
|
||||
diskusi: diskusi,
|
||||
},
|
||||
});
|
||||
|
||||
if (!updt) return { status: 400, message: "Gagal update" };
|
||||
revalidatePath("/dev/forum/main");
|
||||
return { status: 200, message: "Berhasil update" };
|
||||
}
|
||||
Reference in New Issue
Block a user