Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

87
Views
No puedo actualizar mi columna en mi base de datos postgresql
import React, { useState } from 'react'; const Quantity = ({ todo }) => { const [count, setCount] = useState(+todo.count); function decrementCount() { setCount(count - 1) updateCount(count - 1) } function incrementCount() { setCount(count + 1) updateCount(count + 1) } // edit count function const updateCount = async (newCount) => { console.log("this is the newCount", newCount) try { const body = { "newCount" : newCount} const response = await fetch( `http://localhost:5000/todos/${todo.todo.id}`, { method: "PUT", headers: { "Content-Type": "application/json" }, body: JSON.stringify(body) } ); window.location = "/"; } catch (err) { console.error(err.message); } } return ( <> <button onClick={() => decrementCount(count)}>-</button> <span>{count}</span> <button onClick= {() => incrementCount(count)}>+</button> </> ) } export default Quantity;

No puedo hacer que mi aplicación de contador actualice la columna "recuento" en mi tabla postgresql, ¿alguna sugerencia? ¿Debo cambiar todo.todo.id? ¿O debería cambiar el conteo con respecto al onclick en la declaración de devolución?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!