Nico-25 Mei 2025:
Membuat create berita dan gambar Membuat fungsi tombol di mana bisa menghapus konten sesuai idnya
This commit is contained in:
@@ -2,6 +2,8 @@ import Elysia, { t } from "elysia";
|
||||
import kategoriBeritaFindMany from "./category";
|
||||
import beritaFindMany from "./find-many";
|
||||
import beritaCreate from "./create";
|
||||
import beritaDelete from "./del";
|
||||
import beritaUpdate from "./updt";
|
||||
|
||||
const Berita = new Elysia({ prefix: "/berita", tags: ["Desa/Berita"] })
|
||||
.get("/category/find-many", kategoriBeritaFindMany)
|
||||
@@ -14,6 +16,16 @@ const Berita = new Elysia({ prefix: "/berita", tags: ["Desa/Berita"] })
|
||||
content: t.String(),
|
||||
kategoriBeritaId: t.Union([t.String(), t.Null()]),
|
||||
}),
|
||||
})
|
||||
.delete("/delete/:id", beritaDelete)
|
||||
.put("/update/:id", beritaUpdate, {
|
||||
body: t.Object({
|
||||
judul: t.String(),
|
||||
deskripsi: t.String(),
|
||||
imageId: t.String(),
|
||||
content: t.String(),
|
||||
kategoriBeritaId: t.Union([t.String(), t.Null()]),
|
||||
}),
|
||||
});
|
||||
|
||||
export default Berita;
|
||||
|
||||
Reference in New Issue
Block a user