forked from nixcn/nixcn-cms
Add meilisearch for user and event
Signed-off-by: Asai Neko <sugar@sne.moe>
This commit is contained in:
@@ -21,7 +21,7 @@ func Checkin(c *gin.Context) {
|
||||
// Get event id from query
|
||||
eventIdOrig, ok := c.GetQuery("event_id")
|
||||
if !ok {
|
||||
c.JSON(403, gin.H{
|
||||
c.JSON(400, gin.H{
|
||||
"status": "undefinded event id",
|
||||
})
|
||||
return
|
||||
@@ -33,6 +33,7 @@ func Checkin(c *gin.Context) {
|
||||
c.JSON(500, gin.H{
|
||||
"status": "error parsing string to uuid",
|
||||
})
|
||||
return
|
||||
}
|
||||
data.UpdateCheckin(userId.(uuid.UUID), eventId, time.Now())
|
||||
c.JSON(200, gin.H{
|
||||
|
||||
@@ -12,14 +12,16 @@ func Info(c *gin.Context) {
|
||||
data := new(data.User)
|
||||
userId, ok := c.Get("user_id")
|
||||
if !ok {
|
||||
c.JSON(403, gin.H{
|
||||
c.JSON(404, gin.H{
|
||||
"status": "user not found",
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
// Get user from database
|
||||
err := data.GetByUserId(userId.(uuid.UUID))
|
||||
if err != nil {
|
||||
c.JSON(403, gin.H{
|
||||
c.JSON(404, gin.H{
|
||||
"status": "user not found",
|
||||
})
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user