merge create and update playlist

This commit is contained in:
sentriz
2019-11-24 23:09:36 +00:00
parent cca60fbb89
commit 48397b7291
6 changed files with 71 additions and 29 deletions

View File

@@ -37,3 +37,21 @@ func GetIntParamOr(r *http.Request, key string, or int) int {
}
return val
}
func GetFirstParamOf(r *http.Request, keys ...string) []string {
for _, key := range keys {
if val, ok := r.URL.Query()[key]; ok {
return val
}
}
return nil
}
func GetFirstIntParamOf(r *http.Request, keys ...string) (int, bool) {
for _, key := range keys {
if v, err := GetIntParam(r, key); err == nil {
return v, true
}
}
return 0, false
}