mirror of
https://gitlab.com/foxixus/neomovies-api.git
synced 2025-10-27 17:38:51 +05:00
Bug Fix: Fix Delete profile route
This commit is contained in:
10
main.go
10
main.go
@@ -104,7 +104,8 @@ func main() {
|
||||
api.HandleFunc("/movies/upcoming", movieHandler.Upcoming).Methods("GET")
|
||||
api.HandleFunc("/movies/now-playing", movieHandler.NowPlaying).Methods("GET")
|
||||
api.HandleFunc("/movies/{id}", movieHandler.GetByID).Methods("GET")
|
||||
api.HandleFunc("/movies/{id}/recommendations", movieHandler.GetRecommendations).Methods("GET")
|
||||
|
||||
api.HandleFunc("/movies/{id}/recommendations", movieHandler.GetRecommendations).Methods("GET")
|
||||
api.HandleFunc("/movies/{id}/similar", movieHandler.GetSimilar).Methods("GET")
|
||||
api.HandleFunc("/movies/{id}/external-ids", movieHandler.GetExternalIDs).Methods("GET")
|
||||
|
||||
@@ -131,6 +132,8 @@ func main() {
|
||||
// Пользовательские данные
|
||||
protected.HandleFunc("/auth/profile", authHandler.GetProfile).Methods("GET")
|
||||
protected.HandleFunc("/auth/profile", authHandler.UpdateProfile).Methods("PUT")
|
||||
// Новый маршрут удаления аккаунта
|
||||
protected.HandleFunc("/auth/profile", authHandler.DeleteAccount).Methods("DELETE")
|
||||
|
||||
// Реакции (приватные)
|
||||
protected.HandleFunc("/reactions/{mediaType}/{mediaId}/my-reaction", reactionsHandler.GetMyReaction).Methods("GET")
|
||||
@@ -140,7 +143,8 @@ func main() {
|
||||
|
||||
// CORS middleware
|
||||
corsHandler := handlers.CORS(
|
||||
handlers.AllowedOrigins([]string{"*"}),
|
||||
|
||||
handlers.AllowedOrigins([]string{"*"}),
|
||||
handlers.AllowedMethods([]string{"GET", "POST", "PUT", "DELETE", "OPTIONS"}),
|
||||
handlers.AllowedHeaders([]string{"Authorization", "Content-Type", "Accept", "Origin", "X-Requested-With"}),
|
||||
handlers.AllowCredentials(),
|
||||
@@ -177,4 +181,4 @@ func main() {
|
||||
fmt.Printf("❌ Server failed to start: %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user