v1 of loaded manager

This commit is contained in:
ari committed 2022-07-28 15:43:00 -04:00
1 parent a9c3e9c890
commit 96617e7b0c
17 files changed
+295 -88

No files matched your search

+8 -1
View File
@@ -9,11 +9,18 @@ import {
export const useMockAPI = (
initialAutos: AutomationData[] = [],
makeRef = useRef
makeRef = useRef,
returnErrors: boolean = false
): API => {
const automationsRef = makeRef(initialAutos);
return {
async makeCall({ path, method = "POST", data = {} }) {
if (returnErrors) {
return {
ok: false,
error: "Test Error",
};
}
// console.debug("[[mockCall]]", method, path, data);
if (path === AUTOMTAION_LIST) {
return {