Skip to content

Commit

Permalink
adjusts
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaellevissa committed Jun 17, 2024
1 parent cd9f0b0 commit a09711d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
1 change: 0 additions & 1 deletion src/components/FormTransaction/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ export const FormTransaction = ({ userId }: Props) => {
</Label>
<Input
id="value"
type="number"
placeholder="Valor da transação"
className="w-full border p-2 rounded bg-zinc-300"
{...register("value")}
Expand Down
2 changes: 1 addition & 1 deletion src/context/auth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const AuthContext = createContext<Auth>({} as Auth);
export const AuthProvider = ({ children }: ChildrenProvider) => {
function logout() {
localStorage.removeItem("token");
localStorage.removeItem("user");
localStorage.removeItem("taxId");
window.location.href = "/";
}

Expand Down
5 changes: 3 additions & 2 deletions src/hooks/useRegisterUser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,12 @@ export function useRegisterUser() {
},
},
});
localStorage.setItem("user", response.data.createUser.user);

localStorage.setItem("taxId", response.data.createUser.user.taxId);
localStorage.setItem("token", response.data.createUser.token);
navigation("/home");
} catch (error) {
console.log(error);
console.log((error as Error).message);
}
};

Expand Down
10 changes: 7 additions & 3 deletions src/pages/Home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,20 @@ export const Home = () => {
skip: !userId,
});

console.log(transactionReceiverData);

useEffect(() => {
if (
userError ||
accountError ||
transactionSenderError ||
transactionReceiverError
) {
console.error("Erro ao buscar dados:", userError || accountError);
console.error(
"Erro ao buscar dados:",
userError ||
accountError ||
transactionSenderError ||
transactionReceiverError
);
}
}, [userError, accountError]);

Expand Down

0 comments on commit a09711d

Please sign in to comment.