Skip to content

Commit

Permalink
remove middleware for now
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinGallauner committed May 11, 2024
1 parent d7ef13b commit be3a150
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions internal/collection_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ func TestAddBookToUser(t *testing.T) {
}
//when
request, _ := http.NewRequest(http.MethodPost, "/api/collections", strings.NewReader(`{"user_id": 1, "isbn": "1234567890"}`))
request.Header.Add("Authorization", "Bearer test-token")
response := httptest.NewRecorder()
s.ServeHTTP(response, request)

Expand Down
3 changes: 2 additions & 1 deletion internal/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ func NewBookclubServer(client Client, repository BookRepository, userRepository
s.JwtService = jwtService
router := http.NewServeMux() //TODO: add jwtMiddleware to all concerned handler
router.Handle("/api/search", http.HandlerFunc(s.handlerSearch))
router.Handle("/api/collections", http.HandlerFunc(jwtMiddleware(s.handlerAddBook)))
router.Handle("/api/collections", http.HandlerFunc(s.handlerAddBook))
//router.Handle("/api/collections", http.HandlerFunc(jwtMiddleware(s.handlerAddBook)))
router.Handle("/api/books/{isbn}", http.HandlerFunc(s.handlerGetBookByISBN))
router.Handle("/api/users", http.HandlerFunc(s.handlerCreateUser))
router.Handle("/api/links/{id}", http.HandlerFunc(s.handlerGetLinks))
Expand Down

0 comments on commit be3a150

Please sign in to comment.