v1 of loaded manager
This commit is contained in:
1 parent
a9c3e9c890
commit
96617e7b0c
17 files changed
+295
-88
No files matched your search
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user