feat: add mapping functions
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
package user
|
||||
package author
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
@@ -23,7 +23,7 @@ func (u *Controller) ListAuthors(c *gin.Context) {
|
||||
c.AbortWithError(500, err)
|
||||
return
|
||||
}
|
||||
c.JSON(200, authors)
|
||||
c.JSON(200, toAuthorSlice(authors))
|
||||
}
|
||||
|
||||
func (u *Controller) GetAuthorByID(c *gin.Context) {
|
||||
@@ -39,5 +39,5 @@ func (u *Controller) GetAuthorByID(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
c.JSON(200, author)
|
||||
c.JSON(200, toAuthor(author))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user