From 9e3ad19591add2702f2ce70b6546f766b64d52a5 Mon Sep 17 00:00:00 2001 From: zain_arif Date: Mon, 16 Mar 2026 14:54:00 +0700 Subject: [PATCH] fix(api): add api for reset web and WA update --- src/api/web-control.jsx | 14 ++++++++++++++ src/pages/webControl/IndexWebControl.jsx | 2 ++ 2 files changed, 16 insertions(+) create mode 100644 src/api/web-control.jsx diff --git a/src/api/web-control.jsx b/src/api/web-control.jsx new file mode 100644 index 0000000..4162c6a --- /dev/null +++ b/src/api/web-control.jsx @@ -0,0 +1,14 @@ +import { SendRequest } from '../components/Global/ApiRequest'; + +const resetWA = async () => { + const response = await SendRequest({ + method: 'post', + prefix: `notifikasi-wa/restart-wa`, + }); + + return response.data; +}; + +export { + resetWA, +}; diff --git a/src/pages/webControl/IndexWebControl.jsx b/src/pages/webControl/IndexWebControl.jsx index 93a72fb..60af7da 100644 --- a/src/pages/webControl/IndexWebControl.jsx +++ b/src/pages/webControl/IndexWebControl.jsx @@ -1,6 +1,7 @@ import React, { useState, useEffect, memo } from 'react'; import { useNavigate } from 'react-router-dom'; import { Button, Typography } from 'antd'; +import { resetWA } from '../../api/web-control'; import { useBreadcrumb } from '../../layout/LayoutBreadcrumb'; const { Text } = Typography; @@ -19,6 +20,7 @@ const IndexWebControl = memo(function IndexWebControl() { const handleReset = () => { setIsPlaying(false); + resetWA(); }; useEffect(() => {