Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deleting one new todo -> deletes all new todos #3

Open
gonenshafry opened this issue Jul 30, 2019 · 2 comments
Open

deleting one new todo -> deletes all new todos #3

gonenshafry opened this issue Jul 30, 2019 · 2 comments

Comments

@gonenshafry
Copy link

Form submit doesn't generate todo.id, resulting in delete one new todo -> deletes all new todos. Can you please update the code?

@jwhy89
Copy link

jwhy89 commented Nov 22, 2019

Form submit doesn't generate todo.id, resulting in delete one new todo -> deletes all new todos. Can you please update the code?

The id property will always be 201. This is just a test API and so in the real world, the database would auto-increment the value of the id. The deleteTodo function in the todo.service.ts targets the id property only.

deleteTodo(todo: Todo): Observable {
const url = ${this.todosUrl}/${todo.id};
return this.http.delete(url, httpOptions);
}

https://jsonplaceholder.typicode.com/guide.html

@cognitive137
Copy link

This helps, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants