upd: dashbaord admin/
Deksirps: - format surat - view file - api No Issues
This commit is contained in:
@@ -16,11 +16,11 @@ import {
|
||||
} from "@mantine/core";
|
||||
import { useDisclosure, useShallowEffect } from "@mantine/hooks";
|
||||
import { IconEdit } from "@tabler/icons-react";
|
||||
import _ from "lodash";
|
||||
import { useState } from "react";
|
||||
import useSWR from "swr";
|
||||
import ModalFile from "./ModalFile";
|
||||
import notification from "./notificationGlobal";
|
||||
import _ from "lodash";
|
||||
|
||||
export default function DesaSetting() {
|
||||
const [btnDisable, setBtnDisable] = useState(false);
|
||||
@@ -50,7 +50,8 @@ export default function DesaSetting() {
|
||||
let finalData = { ...dataEdit }; // ← buffer data terbaru
|
||||
|
||||
if (dataEdit.name === "TTD") {
|
||||
const resImg = await apiFetch.api.pengaduan.upload.post({ file: img });
|
||||
const oldImg = await apiFetch.api.pengaduan["delete-image"].post({ file: dataEdit.value, folder: "lainnya" });
|
||||
const resImg = await apiFetch.api.pengaduan.upload.post({ file: img, folder: "lainnya" });
|
||||
|
||||
if (resImg.status === 200) {
|
||||
finalData = {
|
||||
@@ -176,7 +177,7 @@ export default function DesaSetting() {
|
||||
<ModalFile
|
||||
open={openedPreview && !_.isEmpty(viewImg)}
|
||||
onClose={() => setOpenedPreview(false)}
|
||||
folder="syarat-dokumen"
|
||||
folder="lainnya"
|
||||
fileName={viewImg}
|
||||
/>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user