[Update/bugfix] To get software version.(show it to the console for now.)
fix the error that was wrong amount arguments.
This commit is contained in:
22
src-ui/logics/useConfig.js
Normal file
22
src-ui/logics/useConfig.js
Normal file
@@ -0,0 +1,22 @@
|
||||
import {
|
||||
useSoftwareVersion,
|
||||
} from "@store";
|
||||
|
||||
import { useStdoutToPython } from "./useStdoutToPython";
|
||||
|
||||
export const useConfig = () => {
|
||||
const {
|
||||
updateSoftwareVersion,
|
||||
} = useSoftwareVersion();
|
||||
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
|
||||
return {
|
||||
getSoftwareVersion: () => {
|
||||
asyncStdoutToPython({endpoint: "/config/version"});
|
||||
},
|
||||
updateSoftwareVersion: (payload) => {
|
||||
updateSoftwareVersion(payload.data);
|
||||
},
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user