pesan perubahan

This commit is contained in:
hoiruguci 2026-05-24 23:30:46 +07:00
parent b2bf4cefe1
commit beab778e1d
1 changed files with 9 additions and 2 deletions

View File

@ -1,8 +1,12 @@
const router = require("express").Router(); const router = require("express").Router();
const { PrismaClient } = require("@prisma/client");
const prisma = require("../prisma/client"); const prisma = require("../prisma/client");
router.get("/", async (req, res) => {
const data = await prisma.bAST.findMany();
res.json(data);
});
router.post("/", async (req, res) => { router.post("/", async (req, res) => {
const data = await prisma.bAST.create({ const data = await prisma.bAST.create({
data: { data: {
@ -11,6 +15,7 @@ router.post("/", async (req, res) => {
status_terima: "Menunggu" status_terima: "Menunggu"
} }
}); });
res.json(data); res.json(data);
}); });
@ -19,6 +24,7 @@ router.put("/approve-serah/:id", async (req, res) => {
where: { bast_id: Number(req.params.id) }, where: { bast_id: Number(req.params.id) },
data: { status_serah: "Approved" } data: { status_serah: "Approved" }
}); });
res.json(data); res.json(data);
}); });
@ -27,6 +33,7 @@ router.put("/approve-terima/:id", async (req, res) => {
where: { bast_id: Number(req.params.id) }, where: { bast_id: Number(req.params.id) },
data: { status_terima: "Approved" } data: { status_terima: "Approved" }
}); });
res.json(data); res.json(data);
}); });