forbid empty querying scores

This commit is contained in:
Morgan Bazalgette 2018-07-19 15:58:35 +02:00
parent daf10b5d71
commit 50ffa4e066

View File

@ -76,6 +76,9 @@ func ScoresGET(md common.MethodData) common.CodeMessager {
Table: "scores",
Allowed: []string{"pp", "score", "accuracy", "id"},
})
if where.Clause == "" {
return ErrMissingField("must specify at least one queried item")
}
where.Where(` scores.completed = '3' AND `+md.User.OnlyUserPublic(false)+` `+
genModeClause(md)+` `+sort+common.Paginate(md.Query("p"), md.Query("l"), 100), "FIF")