Fix Compres Gambar && seed gambar profile - landing page
This commit is contained in:
@@ -11,7 +11,7 @@ export default async function sdgsDesaCreate(context: Context) {
|
||||
const body = context.body as FormCreate;
|
||||
|
||||
try {
|
||||
const result = await prisma.sDGSDesa.create({
|
||||
const result = await prisma.sdgsDesa.create({
|
||||
data: {
|
||||
name: body.name,
|
||||
jumlah: body.jumlah,
|
||||
|
||||
@@ -9,7 +9,7 @@ export default async function sdgsDesaDelete(context: Context) {
|
||||
throw new Error("ID tidak ditemukan dalam parameter");
|
||||
}
|
||||
|
||||
const deleted = await prisma.sDGSDesa.delete({
|
||||
const deleted = await prisma.sdgsDesa.delete({
|
||||
where: { id },
|
||||
});
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ async function sdgsDesaFindMany(context: Context) {
|
||||
|
||||
try {
|
||||
const [data, total] = await Promise.all([
|
||||
prisma.sDGSDesa.findMany({
|
||||
prisma.sdgsDesa.findMany({
|
||||
where,
|
||||
include: {
|
||||
image: true,
|
||||
@@ -30,7 +30,7 @@ async function sdgsDesaFindMany(context: Context) {
|
||||
take: limit,
|
||||
orderBy: { jumlah: "desc" }, // opsional, kalau mau urut berdasarkan waktu
|
||||
}),
|
||||
prisma.sDGSDesa.count({
|
||||
prisma.sdgsDesa.count({
|
||||
where,
|
||||
}),
|
||||
]);
|
||||
|
||||
@@ -9,7 +9,7 @@ export default async function sdgsDesaFindUnique(context: Context) {
|
||||
throw new Error("ID tidak ditemukan dalam parameter");
|
||||
}
|
||||
|
||||
const data = await prisma.sDGSDesa.findUnique({
|
||||
const data = await prisma.sdgsDesa.findUnique({
|
||||
where: { id },
|
||||
include: {
|
||||
image: true,
|
||||
|
||||
@@ -21,7 +21,7 @@ export default async function sdgsDesaUpdate(context: Context) {
|
||||
}
|
||||
|
||||
try {
|
||||
const updated = await prisma.sDGSDesa.update({
|
||||
const updated = await prisma.sdgsDesa.update({
|
||||
where: { id },
|
||||
data: {
|
||||
name: body.name,
|
||||
|
||||
Reference in New Issue
Block a user