fix: admin app info
deskripsi: - penambahan jenis kelamin pada fitur stiker
This commit is contained in:
@@ -60,6 +60,7 @@ async function PUT(request: Request, { params }: { params: { id: string } }) {
|
||||
MasterEmotions: {
|
||||
set: data.emotions.map((value: string) => ({ value })), // ✅ replace relasi
|
||||
},
|
||||
jenisKelamin: data.jenisKelamin,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -78,6 +79,7 @@ async function PUT(request: Request, { params }: { params: { id: string } }) {
|
||||
MasterEmotions: {
|
||||
set: data.emotions.map((value: string) => ({ value })), // ✅ replace relasi
|
||||
},
|
||||
jenisKelamin: data.jenisKelamin,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { prisma } from "@/lib";
|
||||
import { data } from "autoprefixer";
|
||||
import _ from "lodash";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
@@ -8,6 +7,7 @@ export { GET, POST };
|
||||
interface IPostSticker {
|
||||
fileId: string;
|
||||
emotions: string[];
|
||||
gender: "Laki-laki" | "Perempuan" | null;
|
||||
}
|
||||
|
||||
async function POST(request: Request) {
|
||||
@@ -20,7 +20,7 @@ async function POST(request: Request) {
|
||||
}
|
||||
|
||||
try {
|
||||
const { fileId, emotions } = await request.json();
|
||||
const { fileId, emotions, gender } = await request.json();
|
||||
|
||||
const newStiker = await prisma.sticker.create({
|
||||
data: {
|
||||
@@ -28,6 +28,7 @@ async function POST(request: Request) {
|
||||
MasterEmotions: {
|
||||
connect: emotions.map((value: string) => ({ value })), // id = number[]
|
||||
},
|
||||
jenisKelamin: gender,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user