mirror of
https://github.com/go-gitea/gitea.git
synced 2025-08-25 18:14:08 +09:00
Refactor names (#31405)
This PR only does "renaming": * `Route` should be `Router` (and chi router is also called "router") * `Params` should be `PathParam` (to distingush it from URL query param, and to match `FormString`) * Use lower case for private functions to avoid exposing or abusing
This commit is contained in:
@ -14,11 +14,11 @@ import (
|
||||
|
||||
// TaskStatus returns task's status
|
||||
func TaskStatus(ctx *context.Context) {
|
||||
task, opts, err := admin_model.GetMigratingTaskByID(ctx, ctx.ParamsInt64("task"), ctx.Doer.ID)
|
||||
task, opts, err := admin_model.GetMigratingTaskByID(ctx, ctx.PathParamInt64("task"), ctx.Doer.ID)
|
||||
if err != nil {
|
||||
if admin_model.IsErrTaskDoesNotExist(err) {
|
||||
ctx.JSON(http.StatusNotFound, map[string]any{
|
||||
"error": "task `" + strconv.FormatInt(ctx.ParamsInt64("task"), 10) + "` does not exist",
|
||||
"error": "task `" + strconv.FormatInt(ctx.PathParamInt64("task"), 10) + "` does not exist",
|
||||
})
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user