1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-08-05 09:55:20 +02:00

Rename context.Query to context.Form (#16562)

This commit is contained in:
Lunny Xiao 2021-07-29 09:42:15 +08:00 committed by GitHub
parent 3705168837
commit 33e0b38287
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
85 changed files with 393 additions and 396 deletions

View file

@ -171,7 +171,7 @@ func ReadRepoNotifications(ctx *context.APIContext) {
// "$ref": "#/responses/empty"
lastRead := int64(0)
qLastRead := strings.Trim(ctx.Query("last_read_at"), " ")
qLastRead := strings.Trim(ctx.Form("last_read_at"), " ")
if len(qLastRead) > 0 {
tmpLastRead, err := time.Parse(time.RFC3339, qLastRead)
if err != nil {
@ -189,8 +189,8 @@ func ReadRepoNotifications(ctx *context.APIContext) {
UpdatedBeforeUnix: lastRead,
}
if !ctx.QueryBool("all") {
statuses := ctx.QueryStrings("status-types")
if !ctx.FormBool("all") {
statuses := ctx.FormStrings("status-types")
opts.Status = statusStringsToNotificationStatuses(statuses, []string{"unread"})
log.Error("%v", opts.Status)
}
@ -200,7 +200,7 @@ func ReadRepoNotifications(ctx *context.APIContext) {
return
}
targetStatus := statusStringToNotificationStatus(ctx.Query("to-status"))
targetStatus := statusStringToNotificationStatus(ctx.Form("to-status"))
if targetStatus == 0 {
targetStatus = models.NotificationStatusRead
}