Skip to content

Commit

Permalink
Fix naming of a setter
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikzogg committed Mar 10, 2024
1 parent e5b4c7f commit 286fd42
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/hook/use-model-resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const useModelResource = <
updateClient?: UpdateClient<MReq, MRes>;
deleteClient?: DeleteClient;
}) => {
const [isLoading, setLoading] = useState<'list' | 'create' | 'read' | 'update' | 'delete' | undefined>();
const [isLoading, setIsLoading] = useState<'list' | 'create' | 'read' | 'update' | 'delete' | undefined>();
const [modelList, setModelList] = useState<MLRes | undefined>();
const [model, setModel] = useState<MRes | undefined>();
const [httpError, setHttpError] = useState<HttpError | undefined>();
Expand All @@ -31,7 +31,7 @@ export const useModelResource = <
throw new Error('Missing listClient');
}

setLoading('list');
setIsLoading('list');

const response = await listClient(req);

Expand All @@ -48,7 +48,7 @@ export const useModelResource = <
success = true;
}

setLoading(undefined);
setIsLoading(undefined);

return success;
};
Expand All @@ -58,7 +58,7 @@ export const useModelResource = <
throw new Error('Missing createClient');
}

setLoading('create');
setIsLoading('create');

const response = await createClient(req);

Expand All @@ -75,7 +75,7 @@ export const useModelResource = <
success = true;
}

setLoading(undefined);
setIsLoading(undefined);

return success;
};
Expand All @@ -85,7 +85,7 @@ export const useModelResource = <
throw new Error('Missing readClient');
}

setLoading('read');
setIsLoading('read');

const response = await readClient(id);

Expand All @@ -102,7 +102,7 @@ export const useModelResource = <
success = true;
}

setLoading(undefined);
setIsLoading(undefined);

return success;
};
Expand All @@ -112,7 +112,7 @@ export const useModelResource = <
throw new Error('Missing updateClient');
}

setLoading('update');
setIsLoading('update');

const response = await updateClient(id, req);

Expand All @@ -129,7 +129,7 @@ export const useModelResource = <
success = true;
}

setLoading(undefined);
setIsLoading(undefined);

return success;
};
Expand All @@ -139,7 +139,7 @@ export const useModelResource = <
throw new Error('Missing deleteClient');
}

setLoading('update');
setIsLoading('update');

const response = await deleteClient(id);

Expand All @@ -154,7 +154,7 @@ export const useModelResource = <
success = true;
}

setLoading(undefined);
setIsLoading(undefined);

return success;
};
Expand Down

0 comments on commit 286fd42

Please sign in to comment.