fix(api): add api for reset web and WA update
This commit is contained in:
14
src/api/web-control.jsx
Normal file
14
src/api/web-control.jsx
Normal file
@@ -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,
|
||||||
|
};
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
import React, { useState, useEffect, memo } from 'react';
|
import React, { useState, useEffect, memo } from 'react';
|
||||||
import { useNavigate } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
import { Button, Typography } from 'antd';
|
import { Button, Typography } from 'antd';
|
||||||
|
import { resetWA } from '../../api/web-control';
|
||||||
import { useBreadcrumb } from '../../layout/LayoutBreadcrumb';
|
import { useBreadcrumb } from '../../layout/LayoutBreadcrumb';
|
||||||
|
|
||||||
const { Text } = Typography;
|
const { Text } = Typography;
|
||||||
@@ -19,6 +20,7 @@ const IndexWebControl = memo(function IndexWebControl() {
|
|||||||
|
|
||||||
const handleReset = () => {
|
const handleReset = () => {
|
||||||
setIsPlaying(false);
|
setIsPlaying(false);
|
||||||
|
resetWA();
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user