feat: added GET /lists, POST /list/items/{id} and GET /list/{id}

This commit is contained in:
2026-08-21 14:48:38 +02:00
parent ea5dd431e5
commit 51b2b74f0d
5 changed files with 269 additions and 16 deletions
+3
View File
@@ -42,10 +42,13 @@ func NewMux(cfg Config) http.Handler {
apiMux.Handle("POST /users", protected(userHandler.CreateUser))
apiMux.Handle("POST /lists", protected(listHandler.CreateList))
apiMux.Handle("GET /lists", protected(listHandler.GetLists))
apiMux.Handle("POST /lists/user", protected(listHandler.AddUserToList))
apiMux.Handle("DELETE /lists/user", protected(listHandler.RemoveUserFromList))
apiMux.Handle("POST /lists/item", protected(listHandler.CreateListItem))
apiMux.Handle("PUT /lists/item", protected(listHandler.UpdateListItem))
apiMux.Handle("POST /list/items/{id}", protected(listHandler.SetListItemCompleted))
apiMux.Handle("GET /list/{id}", protected(listHandler.GetListItems))
mux := http.NewServeMux()
mux.Handle("/api/v1/", http.StripPrefix("/api/v1", apiMux))