UI & API Menu LandingPage, Submenu Profile

This commit is contained in:
2025-07-23 12:19:10 +08:00
parent 88a10538a7
commit 1bc6dd8dbf
11 changed files with 534 additions and 32 deletions

View File

@@ -2,6 +2,7 @@ import prisma from "@/lib/prisma";
import { Context } from "elysia";
type FormCreate = {
name: string;
imageId: string;
iconUrl: string;
};
@@ -12,6 +13,7 @@ export default async function mediaSosialCreate(context: Context) {
try {
const result = await prisma.mediaSosial.create({
data: {
name: body.name,
imageId: body.imageId,
iconUrl: body.iconUrl,
},

View File

@@ -19,6 +19,7 @@ const MediaSosial = new Elysia({
// ✅ Create
.post("/create", MediaSosialCreate, {
body: t.Object({
name: t.String(),
imageId: t.String(),
iconUrl: t.String(),
}),
@@ -27,6 +28,7 @@ const MediaSosial = new Elysia({
// ✅ Update
.put("/:id", MediaSosialUpdate, {
body: t.Object({
name: t.String(),
imageId: t.Optional(t.String()),
iconUrl: t.Optional(t.String()),
}),

View File

@@ -3,6 +3,7 @@ import prisma from "@/lib/prisma";
import { Context } from "elysia";
type FormUpdateMediaSosial = {
name?: string;
imageId?: string;
iconUrl?: string;
};
@@ -23,6 +24,7 @@ export default async function mediaSosialUpdate(context: Context) {
const updated = await prisma.mediaSosial.update({
where: { id },
data: {
name: body.name,
imageId: body.imageId,
iconUrl: body.iconUrl,
},