Skip to content

Commit

Permalink
temporarily disable update matkul (#80)
Browse files Browse the repository at this point in the history
* feat: disable update matkul

* feat: change disabled conditions

* fix: build error because of unused import
  • Loading branch information
ferryhieronimus authored Jan 14, 2025
1 parent 8e84c8f commit 251e622
Showing 1 changed file with 19 additions and 22 deletions.
41 changes: 19 additions & 22 deletions src/containers/UpdateCourses/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { useEffect } from "react";
import ReactGA from "react-ga";
import Helmet from "react-helmet";
import { useMixpanel } from "hooks/useMixpanel";
import styled from "styled-components";
Expand All @@ -14,9 +13,6 @@ import {
useColorModeValue,
} from "@chakra-ui/react";

import { postScrapeSchedule } from "services/api";

import { InfoToast, SuccessToast, ErrorToast } from "components/Toast";
import { InputPassword, InputText } from "components/Forms";
import { Bauhaus } from "components/Bauhaus";

Expand Down Expand Up @@ -60,24 +56,24 @@ const UpdateCourses = () => {
}, [password, isPasswordChanged]);

const onSubmit = async (values) => {
try {
InfoToast("Sedang memperbaharui jadwal", isMobile, theme);
await postScrapeSchedule(values);
setTimeout(() => {
toast.closeAll();
ReactGA.event({
category: "Update Matkul",
action: "Updated the courses",
});
SuccessToast("Jadwal berhasil diperbaharui", isMobile, theme);
window.location.replace("/susun");
}, 1000);
} catch (e) {
setTimeout(() => {
toast.closeAll();
ErrorToast(e.response.data.message, isMobile, theme);
}, 1000);
}
// try {
// InfoToast("Sedang memperbaharui jadwal", isMobile, theme);
// await postScrapeSchedule(values);
// setTimeout(() => {
// toast.closeAll();
// ReactGA.event({
// category: "Update Matkul",
// action: "Updated the courses",
// });
// SuccessToast("Jadwal berhasil diperbaharui", isMobile, theme);
// window.location.replace("/susun");
// }, 1000);
// } catch (e) {
// setTimeout(() => {
// toast.closeAll();
// ErrorToast(e.response.data.message, isMobile, theme);
// }, 1000);
// }
};

return (
Expand Down Expand Up @@ -126,6 +122,7 @@ const UpdateCourses = () => {
/>
<Alert />
<Button
disabled
mt={8}
colorScheme="teal"
isLoading={isSubmitting}
Expand Down

0 comments on commit 251e622

Please sign in to comment.