@@ -93,11 +93,7 @@ func EventsByBuilding(c *gin.Context) {
9393
9494 // If no building is found, return an error
9595 if eventsByBuilding .Building == "" {
96- c .JSON (http .StatusNotFound , schema.APIResponse [string ]{
97- Status : http .StatusNotFound ,
98- Message : "error" ,
99- Data : "No events found for the specified building" ,
100- })
96+ respond (c , http .StatusNotFound , "error" , "No events found for the specified building" )
10197 return
10298 }
10399
@@ -152,11 +148,7 @@ func EventsByRoom(c *gin.Context) {
152148 }
153149
154150 if eventsByRoom .Room == "" {
155- c .JSON (http .StatusNotFound , schema.APIResponse [string ]{
156- Status : http .StatusNotFound ,
157- Message : "error" ,
158- Data : "No events found for the specified building and room" ,
159- })
151+ respond (c , http .StatusNotFound , "error" , "No events found for the specified building and room" )
160152 return
161153 }
162154
@@ -237,11 +229,7 @@ func SectionsByRoomDetailed(c *gin.Context) {
237229 }
238230
239231 if len (sectionsByRoom .Events ) == 0 {
240- c .JSON (http .StatusNotFound , schema.APIResponse [string ]{
241- Status : http .StatusNotFound ,
242- Message : "error" ,
243- Data : "No section details found" ,
244- })
232+ respond (c , http .StatusNotFound , "error" , "No section details found" )
245233 return
246234 }
247235
0 commit comments