Refactor checkin table to attendance table
Signed-off-by: Asai Neko <sugar@sne.moe>
This commit is contained in:
@@ -8,7 +8,7 @@ import (
|
||||
)
|
||||
|
||||
func Info(c *gin.Context) {
|
||||
event := new(data.Event)
|
||||
eventData := new(data.Event)
|
||||
eventIdOrig, ok := c.GetQuery("event_id")
|
||||
if !ok {
|
||||
c.JSON(400, gin.H{
|
||||
@@ -26,7 +26,7 @@ func Info(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
err = event.GetEventById(eventId)
|
||||
event, err := eventData.GetEventById(eventId)
|
||||
if err != nil {
|
||||
c.JSON(404, gin.H{
|
||||
"status": "event id not found",
|
||||
@@ -35,9 +35,8 @@ func Info(c *gin.Context) {
|
||||
}
|
||||
|
||||
c.JSON(200, gin.H{
|
||||
"name": event.Name,
|
||||
"start_time": event.StartTime,
|
||||
"end_time": event.EndTime,
|
||||
"joined_users": event.JoinedUsers,
|
||||
"name": event.Name,
|
||||
"start_time": event.StartTime,
|
||||
"end_time": event.EndTime,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user