File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed
Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change 55 "github.com/kunalkumar-1/Evently/internals/database"
66)
77
8- func (app * application ) GetUserFromContext (c * gin.Context ) * database.User {
8+ func (app * application ) GetUserFromContext (c * gin.Context ) * database.User {
99 contextUser , exist := c .Get ("user" )
1010 if ! exist {
1111 return & database.User {}
@@ -15,4 +15,4 @@ func(app *application) GetUserFromContext(c *gin.Context) *database.User {
1515 return & database.User {}
1616 }
1717 return user
18- }
18+ }
Original file line number Diff line number Diff line change @@ -24,7 +24,6 @@ func (app *application) createEvent(c *gin.Context) {
2424
2525 user := app .GetUserFromContext (c )
2626 event .OwnerId = user .Id
27-
2827
2928 // Insert into db
3029 err := app .models .Events .Insert (& event )
@@ -112,7 +111,7 @@ func (app *application) updateEvent(c *gin.Context) {
112111 })
113112 return
114113 }
115-
114+
116115 updatedEvent := & database.Event {}
117116
118117 fmt .Println ("Existing Event:" , existingEvent )
@@ -153,8 +152,8 @@ func (app *application) deleteEvent(c *gin.Context) {
153152 if err != nil {
154153 c .JSON (http .StatusInternalServerError , gin.H {
155154 "error" : "Failed to retireve event" ,
156- })
157- }
155+ })
156+ }
158157 if existingEvent == nil {
159158 c .JSON (http .StatusNotFound , gin.H {
160159 "erorr" : "Event not found" ,
@@ -176,7 +175,7 @@ func (app *application) deleteEvent(c *gin.Context) {
176175 }
177176
178177 c .JSON (http .StatusNoContent , nil )
179-
178+
180179}
181180
182181func (app * application ) addAttendeeToEvent (c * gin.Context ) {
You can’t perform that action at this time.
0 commit comments