Skip to content

Commit

Permalink
updating http codes
Browse files Browse the repository at this point in the history
  • Loading branch information
dmnyu committed Jul 10, 2024
1 parent 33d3014 commit f6b949f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions controllers/entriesController.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func GetPreviousEntry(c *gin.Context) {
return
}

c.Redirect(http.StatusTemporaryRedirect, fmt.Sprintf("/entries/%s/show", prevEntryID))
c.Redirect(http.StatusFound, fmt.Sprintf("/entries/%s/show", prevEntryID))
}

func GetNextEntry(c *gin.Context) {
Expand All @@ -124,7 +124,7 @@ func GetNextEntry(c *gin.Context) {
return
}

c.Redirect(http.StatusTemporaryRedirect, fmt.Sprintf("/entries/%s/show", prevEntryID))
c.Redirect(http.StatusFound, fmt.Sprintf("/entries/%s/show", prevEntryID))
}

func GetEntries(c *gin.Context) {
Expand Down Expand Up @@ -350,7 +350,7 @@ func DeleteEntry(c *gin.Context) {
return
}

c.Redirect(http.StatusTemporaryRedirect, fmt.Sprintf("/accessions/%d/show", entry.AccessionID))
c.Redirect(http.StatusFound, fmt.Sprintf("/accessions/%d/show", entry.AccessionID))

}

Expand Down
14 changes: 7 additions & 7 deletions controllers/userController.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func CreateUser(c *gin.Context) {
return
}

c.Redirect(http.StatusTemporaryRedirect, "/users")
c.Redirect(http.StatusFound, "/users")
}

func AuthenticateUser(c *gin.Context) {
Expand Down Expand Up @@ -141,7 +141,7 @@ func AuthenticateUser(c *gin.Context) {
throwError(http.StatusInternalServerError, "failed to update user", c)
}

c.Redirect(http.StatusTemporaryRedirect, "/")
c.Redirect(http.StatusFound, "/")
}

func ResetUserPassword(c *gin.Context) {
Expand Down Expand Up @@ -206,7 +206,7 @@ func ResetPassword(c *gin.Context) {
return
}

c.Redirect(http.StatusTemporaryRedirect, "/users")
c.Redirect(http.StatusFound, "/users")
}

func DeactivateUser(c *gin.Context) {
Expand Down Expand Up @@ -235,7 +235,7 @@ func DeactivateUser(c *gin.Context) {
return
}

c.Redirect(http.StatusTemporaryRedirect, "/users")
c.Redirect(http.StatusFound, "/users")

}

Expand Down Expand Up @@ -265,7 +265,7 @@ func ReactivateUser(c *gin.Context) {
return
}

c.Redirect(http.StatusTemporaryRedirect, "/users")
c.Redirect(http.StatusFound, "/users")

}

Expand Down Expand Up @@ -295,7 +295,7 @@ func MakeUserAdmin(c *gin.Context) {
return
}

c.Redirect(http.StatusTemporaryRedirect, "/users")
c.Redirect(http.StatusFound, "/users")
}

func RemoveUserAdmin(c *gin.Context) {
Expand Down Expand Up @@ -324,7 +324,7 @@ func RemoveUserAdmin(c *gin.Context) {
return
}

c.Redirect(http.StatusTemporaryRedirect, "/users")
c.Redirect(http.StatusFound, "/users")
}

func LoginUser(c *gin.Context) { c.HTML(http.StatusOK, "users-login.html", gin.H{}) }
Expand Down

0 comments on commit f6b949f

Please sign in to comment.