Added DeleteProject handler, untested
This commit is contained in:
parent
cd74758b2f
commit
dce91943b3
2 changed files with 13 additions and 1 deletions
|
@ -30,6 +30,18 @@ func (gs *GState) CreateProject(c *fiber.Ctx) error {
|
|||
return c.Status(200).SendString("Project added")
|
||||
}
|
||||
|
||||
func (gs *GState) DeleteProject(c *fiber.Ctx) error {
|
||||
|
||||
projectID := c.Params("projectID")
|
||||
username := c.Params("username")
|
||||
|
||||
if err := gs.Db.DeleteProject(projectID, username); err != nil {
|
||||
return c.Status(500).SendString((err.Error()))
|
||||
}
|
||||
|
||||
return c.Status(200).SendString("Project deleted")
|
||||
}
|
||||
|
||||
// GetUserProjects returns all projects that the user is a member of
|
||||
func (gs *GState) GetUserProjects(c *fiber.Ctx) error {
|
||||
// First we get the username from the token
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue