sbshah97 / surrealdb-go-starter-project

SurrealDB Starter Project using Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Integrate DELETE with surreal delete method

sbshah97 opened this issue · comments

What happens right now?

Right now this returns 4xx

How do I reproduce / test this

curl --location --request DELETE 'http://localhost:8080/users/{userId}'

What needs to be done?

  • Go to main.go and create a new route called /users/:id/delete
  • This /users/:id/delete calls a new handler called DeleteUsers which is present in handlers/users.go.
  • DeleteUsers should call database.Delete method which needs to be implemented.

A user will need to be created via the post method before deleting it. It will output a userID which can be used instead of userId

Similar PRs to look at