React,js + Prisma better way to update sql with a button – Mysql
async function change_status(object_id:number){ const response = await fetch('/api/db', { method: 'POST', body: JSON.parse(`{"id":${object_id}}`) }); if (!response.ok){ throw new Error(response.statusText); } return await response.json(); } I want this button to change an int in mysql <button onClick={() => change_status(object.id)}> change Status…