Skip to content

Commit

Permalink
fix: unused usestate
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickwebsdev committed Nov 8, 2024
1 parent 24f5d10 commit 0536e0e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 0 additions & 2 deletions src/components/ChangeUrgencyHelpRequest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export default function ChangeUrgencyHelpRequest({
const { toggleModal } = useModal();
const [isLoading, setLoading] = useState(false);
const [error, setError] = useState({});
const [data, setData] = useState({});
const [status, setStatus] = useState<string>(currentUrgency);

const MODAL_NAME = `Actualizar-Solicitud-${helpRequestId}`;
Expand All @@ -43,7 +42,6 @@ export default function ChangeUrgencyHelpRequest({
return;
}
if (data) {
setData(data);
onUpdate(status);
}
toggleModal(MODAL_NAME, false);
Expand Down
6 changes: 3 additions & 3 deletions src/components/DeleteHelpRequest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export default function DeleteHelpRequest({ helpRequestId, onDelete }: DeleteReq
const { toggleModal } = useModal();
const [isLoading, setLoading] = useState(false);
const [error, setError] = useState({});
const [data, setData] = useState({});

const MODAL_NAME = `Eliminar-Solicitud-${helpRequestId}`;

Expand All @@ -31,8 +30,9 @@ export default function DeleteHelpRequest({ helpRequestId, onDelete }: DeleteReq
setError(error);
return;
}
if (data) setData(data);
onDelete();
if (data) {
onDelete();
}
toggleModal(MODAL_NAME, false);
}
async function handleSubmit(e: MouseEvent) {
Expand Down

0 comments on commit 0536e0e

Please sign in to comment.