Take int instead of int64
This commit is contained in:
parent
e57b7a7089
commit
91aee60bfb
2 changed files with 8 additions and 8 deletions
|
|
@ -125,7 +125,7 @@ func declareAPIAuthRepositoriesRoutes(router *gin.RouterGroup) {
|
|||
w = work.(*Work)
|
||||
} else if repository.IdWork > 0 {
|
||||
var err error
|
||||
w, err = getWork(int(repository.IdWork))
|
||||
w, err = getWork(repository.IdWork)
|
||||
if err != nil {
|
||||
c.AbortWithStatusJSON(http.StatusNotFound, gin.H{"errmsg": "Unable to find the given work identifier."})
|
||||
return
|
||||
|
|
@ -187,7 +187,7 @@ func declareAPIAuthRepositoriesRoutes(router *gin.RouterGroup) {
|
|||
repositoriesRoutes.DELETE("", func(c *gin.Context) {
|
||||
loggeduser := c.MustGet("LoggedUser").(*User)
|
||||
repository := c.MustGet("repository").(*Repository)
|
||||
work, err := getWork(int(repository.IdWork))
|
||||
work, err := getWork(repository.IdWork)
|
||||
if err != nil {
|
||||
c.AbortWithStatusJSON(http.StatusInternalServerError, gin.H{"errmsg": "Unable to find related work."})
|
||||
return
|
||||
|
|
@ -219,7 +219,7 @@ func declareAPIAuthRepositoriesRoutes(router *gin.RouterGroup) {
|
|||
u = loggeduser
|
||||
}
|
||||
repo := c.MustGet("repository").(*Repository)
|
||||
work, err := getWork(int(repo.IdWork))
|
||||
work, err := getWork(repo.IdWork)
|
||||
if err != nil {
|
||||
c.AbortWithStatusJSON(http.StatusInternalServerError, gin.H{"errmsg": "Unable to find related work."})
|
||||
return
|
||||
|
|
@ -309,7 +309,7 @@ func declareAPIAuthRepositoriesRoutes(router *gin.RouterGroup) {
|
|||
u = loggeduser
|
||||
}
|
||||
repo := c.MustGet("repository").(*Repository)
|
||||
work, err := getWork(int(repo.IdWork))
|
||||
work, err := getWork(repo.IdWork)
|
||||
if err != nil {
|
||||
c.AbortWithStatusJSON(http.StatusInternalServerError, gin.H{"errmsg": "Unable to find related work."})
|
||||
return
|
||||
|
|
@ -361,7 +361,7 @@ func declareCallbacksRoutes(router *gin.RouterGroup) {
|
|||
return
|
||||
}
|
||||
|
||||
work, err := getWork(int(repo.IdWork))
|
||||
work, err := getWork(repo.IdWork)
|
||||
if err != nil {
|
||||
log.Println("Unable to getWork:", err.Error())
|
||||
c.AbortWithStatusJSON(http.StatusInternalServerError, gin.H{"errmsg": "Unable to find related work."})
|
||||
|
|
@ -387,7 +387,7 @@ func declareCallbacksRoutes(router *gin.RouterGroup) {
|
|||
// Allow to use a secret for another tag
|
||||
if len(repos) > 1 {
|
||||
for _, r := range repos {
|
||||
w, err := getWork(int(r.IdWork))
|
||||
w, err := getWork(r.IdWork)
|
||||
if err != nil {
|
||||
log.Println("Unable to getWork:", err.Error())
|
||||
continue
|
||||
|
|
|
|||
Reference in a new issue