pern-todo-app's People
Forkers
sluscis victorhigaki mcrrsolutions18 loikite carlosiusalazar lewisbolaton rustamtm dejiadepetu vacuum757 sbunlu quinnbanaandev mikeadossi mehmet-emin-git castlearg sirajb josedelator ramarimei paulinall krishnatray developers-institute-classrooms wahyu-k loribean chewjta faustc908 appdev0111 omarz8 valentinganchev1988 michaelbotur haneesh001 abhiwebdev202 weiichengg devesh21700kumar maraina purgatorygates hassanalikhan87 developmentstudio7o7 dehiron miomaeshima ajithonline paritoshtech mtiahrt cmshim shinchima mecanto mecantosvtu jasonwilger haopengsun lucyefranco gingerroth marusoft abcdeleon benjamin-kooprime stimacm77 jeyag nis130 dadarvin 137rx alvissraghnall aspiteri-bcgov limath timothywongej tinkercoding ramaprasadguduru urielgoncalves maxigadea whoops1e habib302 emmanuelkyeremeh navfal-dev mmeii alamaillesuivante miki-saarna ericschorling emmamccracken elizavetapanasiuk msanttos ceejayski nicport milanprpa lucasdmaley onava84 dkimbi naynaydoshkeh3 baisali-03 nataperalta mbusakwe hrwatts adelgadomx risuii devandapaige tulaneadam sergjohn rgltalatala gladiopeace krissytaft amogh-nigam nikhilgit142 l4it-julz nandhinigopal20 salakatenzingpern-todo-app's Issues
Implementing prompt rather than a new component for editing a todo
In between the tutorial, I wanted to give a try to editing the todo using a prompt function instead of calling the EditTodo Component. This is the implementation I could achieve so far
const editTodo = async (todoId: number) => {
let newTodo = prompt("Enter the new todo");
if (newTodo) {
try {
const editTodo = await fetch(
`http://localhost:5000/todos/${todoId}`,
{
method: "PUT",
headers: {
"Content-type": "application/json",
},
body: JSON.stringify({
description: newTodo,
}),
}
);
getTodos();
window.location.href = "/";
} catch (err: any) {
console.error(err.message);
}
}
};
I didn't change anything on the server-side, and apparently, when I edit a todo, it gets edited but moves to the last of the list. I realized this happens even if I'm making the request from postman, is this a Postgres thing? and is there any workaround to avoid this little bug?
Thanks a lot in advance
i have been trying to fellow the tutorial ,and i found this problem !
Hello guys , i really hope that i can understand or have an answer for this problem i am having right now.
actually i can console.log the whole request , but after adding this part that is coded in min 18:16 => 19:36
"const { description } = req.body;
const newTodo = await pool.query(
"INSERT INTO todo (description) VALUES($1) RETURNING *",
[description]
);
" i find a problem . i have this error message : "Cannot read properties of undefined (reading 'query')"
i ill be rally greatful if there is any explination for that !
Error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.