@@ -155,30 +155,32 @@ func registerHandler(app app.App) *mux.Router {
155155 public .HandleFunc ("/images" , app .ImageHandler .UploadImage ).Methods (http .MethodPost )
156156 public .HandleFunc ("/blogs" , app .BlogPostHandler .GetAllBlogPosts ).Methods (http .MethodGet )
157157 public .HandleFunc ("/blogs/{slug}" , app .BlogPostHandler .GetDetailBlogPost ).Methods (http .MethodGet )
158-
158+
159159 protectedV1Route := v1 .NewRoute ().Subrouter ()
160160 protectedV1Route .Use (app .Middleware .AuthMiddleware (constants .RoleUser ))
161-
161+
162162 protectedV1AdminRoute := v1 .PathPrefix ("/admin" ).Subrouter ()
163163 protectedV1AdminRoute .Use (app .Middleware .AuthMiddleware (constants .RoleAdmin ))
164-
164+
165165 protectedV1Route .HandleFunc ("/users" , app .UserHandler .GetUsers ).Methods (http .MethodGet )
166166 protectedV1Route .HandleFunc ("/user" , app .UserHandler .GetUserProfile ).Methods (http .MethodGet )
167167 protectedV1Route .HandleFunc ("/logout" , app .UserHandler .Logout ).Methods (http .MethodPost )
168-
168+
169169 protectedV1Route .HandleFunc ("/" , app .UserHandler .GetUserById ).Methods (http .MethodGet )
170170 protectedV1Route .HandleFunc ("/update" , app .UserHandler .UpdateProfileUser ).Methods (http .MethodPut )
171171 protectedV1Route .HandleFunc ("/delete" , app .UserHandler .DeleteUser ).Methods (http .MethodDelete )
172-
172+
173173 protectedV1Route .HandleFunc ("/events" , app .EventHandler .CreateEvent ).Methods (http .MethodPost )
174174 protectedV1Route .HandleFunc ("/events/registrations" , app .EventHandler .RegisterEvent ).Methods (http .MethodPost )
175175 protectedV1Route .HandleFunc ("/events/registrations" , app .EventHandler .ListRegistration ).Methods (http .MethodGet )
176176 protectedV1Route .HandleFunc ("/events/pays" , app .EventHandler .ListEventPay ).Methods (http .MethodGet )
177177 protectedV1Route .HandleFunc ("/events/pays" , app .EventHandler .PayProcess ).Methods (http .MethodPost )
178+ protectedV1Route .HandleFunc ("/events/pay" , app .EventHandler .PayEvent ).Methods (http .MethodPost )
178179 protectedV1Route .HandleFunc ("/events/{id}" , app .EventHandler .GetEventByID ).Methods (http .MethodGet )
179180 protectedV1Route .HandleFunc ("/events/registrations" , app .EventHandler .RegisterEvent ).Methods (http .MethodPost )
180181
181182 protectedV1Route .HandleFunc ("/images" , app .ImageHandler .UploadImage ).Methods (http .MethodPost )
183+ protectedV1Route .HandleFunc ("/images/{id}" , app .ImageHandler .UpdateImage ).Methods (http .MethodPut )
182184
183185 protectedV1Route .HandleFunc ("/blogs" , app .BlogPostHandler .CreateBlogPost ).Methods (http .MethodPost )
184186 public .HandleFunc ("/blogs" , app .BlogPostHandler .GetAllBlogPosts ).Methods (http .MethodGet )
@@ -187,7 +189,7 @@ func registerHandler(app app.App) *mux.Router {
187189 protectedV1Route .HandleFunc ("/blogs/{id}" , app .BlogPostHandler .DeleteBlogPost ).Methods (http .MethodDelete )
188190
189191 protectedV1AdminRoute .HandleFunc ("/events" , app .EventHandler .CreateEvent ).Methods (http .MethodPost )
190- protectedV1AdminRoute .HandleFunc ("/events" , app .EventHandler .GetEvents ).Methods (http .MethodGet )
192+ protectedV1Route .HandleFunc ("/events" , app .EventHandler .GetEvents ).Methods (http .MethodGet )
191193 protectedV1AdminRoute .HandleFunc ("/events/{id}" , app .EventHandler .DeleteEvent ).Methods (http .MethodDelete )
192194 protectedV1AdminRoute .HandleFunc ("/events/{id}" , app .EventHandler .GetDetail ).Methods (http .MethodGet )
193195
0 commit comments