fix event draft ajukan kembali

This commit is contained in:
2025-03-03 15:37:23 +08:00
parent 0d2d39ccc4
commit ceab376a62
2 changed files with 25 additions and 23 deletions

View File

@@ -23,33 +23,36 @@ import { Event_funDeleteById } from "../../fun/delete/fun_delete";
import { Event_funEditStatusById } from "../../fun/edit/fun_edit_status_by_id";
export default function Event_DetailDraft() {
const params = useParams<{ id: string }>();
const eventId = params.id as string;
const [data, setData] = useState<MODEL_EVENT | null>(null);
const params = useParams<{ id: string }>();
const eventId = params.id as string;
const [data, setData] = useState<MODEL_EVENT | null>(null);
useShallowEffect(() => {
onLoadData();
}, []);
useShallowEffect(() => {
onLoadData();
}, []);
async function onLoadData() {
try {
const respone = await apiGetEventDetailById({
id: eventId,
});
async function onLoadData() {
try {
const respone = await apiGetEventDetailById({
id: eventId,
});
if (respone) {
setData(respone.data);
}
} catch (error) {
clientLogger.error("Error get data detail event", error);
}
}
if (respone) {
setData(respone.data);
}
} catch (error) {
clientLogger.error("Error get data detail event", error);
}
}
return (
<>
<Stack spacing={"lg"}>
<ComponentEvent_DetailData isReport data={data} />
<ButtonAction eventId={eventId} endDate={data?.tanggalSelesai} />
<ButtonAction
eventId={eventId}
endDate={data?.tanggalSelesai}
/>
</Stack>
</>
);
@@ -62,7 +65,6 @@ function ButtonAction({ eventId, endDate }: { eventId: string; endDate: any }) {
const [openModal1, setOpenModal1] = useState(false);
const [openModal2, setOpenModal2] = useState(false);
async function onDelete() {
try {
const res = await Event_funDeleteById(eventId);
@@ -86,7 +88,9 @@ function ButtonAction({ eventId, endDate }: { eventId: string; endDate: any }) {
}
async function onAjukan() {
if (moment(endDate.toISOString().toString()).diff(moment(), "minutes") < 0)
// console.log("end Date", endDate)
if (moment(endDate).diff(moment(), "minutes") < 0)
return ComponentGlobal_NotifikasiPeringatan("Waktu acara telah lewat");
try {

View File

@@ -77,8 +77,6 @@ export default function HomeViewNew() {
}
}
console.log("count >", countNtf);
console.log("user >", dataUser);
return (
<>