Skip to content

Commit

Permalink
corrige o erro de salvamento
Browse files Browse the repository at this point in the history
  • Loading branch information
Afrontoso committed Feb 1, 2025
1 parent e78bbd4 commit 2969e35
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/app/private/pages/criaPublicacao.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default function CriaPublicacao() {
const getIdUsuario = () => {
AsyncStorage.getItem("usuario").then((response) => {
const usuario = JSON.parse(response as string) as IUser;
setIdUsuario(usuario.id);
setIdUsuario(Number(usuario.id));
});
AsyncStorage.getItem("token").then((response) => {
setToken(response as string);
Expand Down
4 changes: 2 additions & 2 deletions src/app/private/pages/criarDenuncia.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export default function CriarDenuncia() {
}

const body = {
idUsuario: idUsuario,
idUsuario: Number(idUsuario),
motivo: report.motivo,
descricao: report.descricao,
publicacaoId: Number(publicacao.id),
Expand All @@ -104,7 +104,7 @@ export default function CriarDenuncia() {
return;
}

await updatePublicacao(publicacao.id, { idUsuarioReporte: [idUsuario] }, token);
await updatePublicacao(publicacao.id, { idUsuarioReporte: [Number(idUsuario)] }, token);

alert("Denúncia realizada com sucesso");
router.push({ pathname: "/private/tabs/forum" });
Expand Down

0 comments on commit 2969e35

Please sign in to comment.