Fix: Event
Deksripsi - Fix notifikasi - Fix load beranda - Fix reload button di admin
This commit is contained in:
@@ -39,7 +39,6 @@ function Job_ComponentButtonSaveCreate({
|
||||
|
||||
if (createNoFile.status === 201) {
|
||||
const dataNotifikasi: IRealtimeData = {
|
||||
userRole: "ADMIN",
|
||||
appId: createNoFile.data?.id as any,
|
||||
status: createNoFile.data?.MasterStatus?.name as any,
|
||||
userId: createNoFile.data?.authorId as any,
|
||||
@@ -58,6 +57,12 @@ function Job_ComponentButtonSaveCreate({
|
||||
pushNotificationTo: "ADMIN",
|
||||
});
|
||||
|
||||
WibuRealtime.setData({
|
||||
type: "trigger",
|
||||
pushNotificationTo: "ADMIN",
|
||||
dataMessage: dataNotifikasi,
|
||||
});
|
||||
|
||||
setHotMenu(2);
|
||||
router.replace(RouterJob.status({ id: "2" }));
|
||||
setIsLoading(true);
|
||||
@@ -82,9 +87,8 @@ function Job_ComponentButtonSaveCreate({
|
||||
|
||||
if (createWithFile.status === 201) {
|
||||
const dataNotifikasi: IRealtimeData = {
|
||||
userRole: "ADMIN",
|
||||
appId: createWithFile.data?.id as any,
|
||||
status: "Review",
|
||||
status: createWithFile.data?.MasterStatus?.name as any,
|
||||
userId: createWithFile.data?.authorId as any,
|
||||
pesan: createWithFile.data?.title as any,
|
||||
kategoriApp: "JOB",
|
||||
@@ -101,6 +105,12 @@ function Job_ComponentButtonSaveCreate({
|
||||
pushNotificationTo: "ADMIN",
|
||||
});
|
||||
|
||||
WibuRealtime.setData({
|
||||
type: "trigger",
|
||||
pushNotificationTo: "ADMIN",
|
||||
dataMessage: dataNotifikasi,
|
||||
});
|
||||
|
||||
setHotMenu(2);
|
||||
router.replace(RouterJob.status({ id: "2" }));
|
||||
setIsLoading(true);
|
||||
|
||||
@@ -8,23 +8,17 @@ export function Job_ComponentButtonUpdateBeranda({
|
||||
onSetData,
|
||||
onSetIsNewPost,
|
||||
}: {
|
||||
onSetData: (val : {data: any[]}) => void;
|
||||
onSetData: (val: any[]) => void;
|
||||
onSetIsNewPost: (val: any) => void;
|
||||
}) {
|
||||
const [scroll, scrollTo] = useWindowScroll();
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
|
||||
async function onLoadData() {
|
||||
setIsLoading(true)
|
||||
async function onLoadNewData() {
|
||||
setIsLoading(true);
|
||||
const loadData = await job_getAllListPublish({ page: 1 });
|
||||
|
||||
if (loadData) {
|
||||
onSetData({
|
||||
data: loadData,
|
||||
});
|
||||
onSetIsNewPost(false);
|
||||
setIsLoading(false);
|
||||
}
|
||||
onSetData(loadData);
|
||||
onSetIsNewPost(false);
|
||||
setIsLoading(false);
|
||||
}
|
||||
|
||||
return (
|
||||
@@ -40,10 +34,10 @@ export function Job_ComponentButtonUpdateBeranda({
|
||||
loaderPosition="center"
|
||||
loading={isLoading ? true : false}
|
||||
radius={"xl"}
|
||||
opacity={scroll.y > 0 ? 0.5 : 0.8}
|
||||
onClick={() => onLoadData()}
|
||||
opacity={0.8}
|
||||
onClick={() => onLoadNewData()}
|
||||
>
|
||||
Update beranda
|
||||
Update beranda
|
||||
</Button>
|
||||
</Center>
|
||||
</Affix>
|
||||
|
||||
Reference in New Issue
Block a user