APIv4 DELETE /users/{user_id}/posts/{post_id}/reactions/name (#6117)
* APIv4 DELETE /users/{user_id}/posts/{post_id}/reactions/name
* updated v3 deleteReaction endpoint
* update parameter of app.DeleteReactionForPost()
* update utils.IsValidAlphaNum, add utils.IsValidAlphaNumHyphenUnderscore, and add related tests
Этот коммит содержится в:
коммит произвёл
Harrison Healey
родитель
e62afeace0
Коммит
ecb10ed62f
@@ -468,7 +468,7 @@ func (c *Context) RequireCategory() *Context {
|
||||
return c
|
||||
}
|
||||
|
||||
if !model.IsValidAlphaNum(c.Params.Category, true) {
|
||||
if !model.IsValidAlphaNumHyphenUnderscore(c.Params.Category, true) {
|
||||
c.SetInvalidUrlParam("category")
|
||||
}
|
||||
|
||||
@@ -492,13 +492,25 @@ func (c *Context) RequirePreferenceName() *Context {
|
||||
return c
|
||||
}
|
||||
|
||||
if !model.IsValidAlphaNum(c.Params.PreferenceName, true) {
|
||||
if !model.IsValidAlphaNumHyphenUnderscore(c.Params.PreferenceName, true) {
|
||||
c.SetInvalidUrlParam("preference_name")
|
||||
}
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
func (c *Context) RequireEmojiName() *Context {
|
||||
if c.Err != nil {
|
||||
return c
|
||||
}
|
||||
|
||||
if len(c.Params.EmojiName) == 0 || len(c.Params.EmojiName) > 64 || !model.IsValidAlphaNumHyphenUnderscore(c.Params.EmojiName, false) {
|
||||
c.SetInvalidUrlParam("emoji_name")
|
||||
}
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
func (c *Context) RequireHookId() *Context {
|
||||
if c.Err != nil {
|
||||
return c
|
||||
|
||||
Ссылка в новой задаче
Block a user