This commit is contained in:
felinae98
2022-10-07 00:57:12 +08:00
parent 469dc8877b
commit 89787a187d
10 changed files with 392 additions and 50 deletions
@@ -1,28 +1,32 @@
import React from 'react';
import { WeightConfig } from '../../utils/type';
import { useGetWeightQuery, useUpdateWeightMutation } from './weightConfigSlice';
// import { WeightConfig } from '../../utils/type';
// import { useGetWeightQuery, useUpdateWeightMutation } from './weightConfigSlice';
//
// export default function WeightManager() {
// const { data: weight } = useGetWeightQuery();
// const [updateWeight] = useUpdateWeightMutation();
//
// const doUpdate = () => {
// const weightConfig: WeightConfig = {
// default: 20,
// time_config: [
// {
// start_time: '01:00',
// end_time: '02:00',
// weight: 50,
// },
// ],
// };
// updateWeight({ weight: weightConfig, platform_name: 'weibo', target: '' });
// };
// return (
// <>
// <div>{weight && JSON.stringify(weight)}</div>
// <button type="button" onClick={doUpdate}> 123</button>
// </>
// );
// }
export default function WeightManager() {
const { data: weight } = useGetWeightQuery();
const [updateWeight] = useUpdateWeightMutation();
const doUpdate = () => {
const weightConfig: WeightConfig = {
default: 20,
time_config: [
{
start_time: '01:00',
end_time: '02:00',
weight: 50,
},
],
};
updateWeight({ weight: weightConfig, platform_name: 'weibo', target: '' });
};
return (
<>
<div>{weight && JSON.stringify(weight)}</div>
<button type="button" onClick={doUpdate}> 123</button>
</>
);
export default function WeightConfig() {
return <div></div>;
}