From 142915d71e2a0d12bdf17308e3fa69605fc5ca14 Mon Sep 17 00:00:00 2001 From: Dominik Zogg Date: Sun, 10 Mar 2024 21:50:18 +0100 Subject: [PATCH] Fix naming of a setter --- src/hook/create-model-resource.ts | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/hook/create-model-resource.ts b/src/hook/create-model-resource.ts index 8d2c870..329c250 100644 --- a/src/hook/create-model-resource.ts +++ b/src/hook/create-model-resource.ts @@ -21,7 +21,7 @@ export const createModelResource = < updateClient?: UpdateClient; deleteClient?: DeleteClient; }) => { - const [isLoading, setLoading] = createSignal<'list' | 'create' | 'read' | 'update' | 'delete' | undefined>(); + const [isLoading, setIsLoading] = createSignal<'list' | 'create' | 'read' | 'update' | 'delete' | undefined>(); const [getModelList, setModelList] = createSignal(); const [getModel, setModel] = createSignal(); const [getHttpError, setHttpError] = createSignal(); @@ -31,7 +31,7 @@ export const createModelResource = < throw new Error('Missing listClient'); } - setLoading('list'); + setIsLoading('list'); const response = await listClient(req); @@ -48,7 +48,7 @@ export const createModelResource = < success = true; } - setLoading(undefined); + setIsLoading(undefined); return success; }; @@ -58,7 +58,7 @@ export const createModelResource = < throw new Error('Missing createClient'); } - setLoading('create'); + setIsLoading('create'); const response = await createClient(req); @@ -75,7 +75,7 @@ export const createModelResource = < success = true; } - setLoading(undefined); + setIsLoading(undefined); return success; }; @@ -85,7 +85,7 @@ export const createModelResource = < throw new Error('Missing readClient'); } - setLoading('read'); + setIsLoading('read'); const response = await readClient(id); @@ -102,7 +102,7 @@ export const createModelResource = < success = true; } - setLoading(undefined); + setIsLoading(undefined); return success; }; @@ -112,7 +112,7 @@ export const createModelResource = < throw new Error('Missing updateClient'); } - setLoading('update'); + setIsLoading('update'); const response = await updateClient(id, req); @@ -129,7 +129,7 @@ export const createModelResource = < success = true; } - setLoading(undefined); + setIsLoading(undefined); return success; }; @@ -139,7 +139,7 @@ export const createModelResource = < throw new Error('Missing deleteClient'); } - setLoading('update'); + setIsLoading('update'); const response = await deleteClient(id); @@ -154,7 +154,7 @@ export const createModelResource = < success = true; } - setLoading(undefined); + setIsLoading(undefined); return success; };