@@ -8,11 +8,17 @@ import (
|
||||
)
|
||||
|
||||
func Query(c *gin.Context) {
|
||||
userId, ok := c.Get("user_id")
|
||||
userIdOrig, ok := c.Get("user_id")
|
||||
if !ok {
|
||||
c.JSON(400, gin.H{"status": "could not found user_id"})
|
||||
return
|
||||
}
|
||||
userId, err := uuid.Parse(userIdOrig.(string))
|
||||
if err != nil {
|
||||
c.JSON(500, gin.H{
|
||||
"status": "failed to parse uuid",
|
||||
})
|
||||
}
|
||||
|
||||
eventIdOrig, ok := c.GetQuery("event_id")
|
||||
if !ok {
|
||||
@@ -26,7 +32,7 @@ func Query(c *gin.Context) {
|
||||
}
|
||||
|
||||
attendanceData := new(data.Attendance)
|
||||
attendance, err := attendanceData.GetAttendance(userId.(uuid.UUID), eventId)
|
||||
attendance, err := attendanceData.GetAttendance(userId, eventId)
|
||||
if err != nil {
|
||||
c.JSON(500, gin.H{"status": "database error"})
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user