fix openpitrix resource sort param

Signed-off-by: hongming <talonwan@yunify.com>
This commit is contained in:
hongming
2019-11-08 17:13:26 +08:00
parent 7a909e574e
commit 981669ca5a
5 changed files with 11 additions and 6 deletions

View File

@@ -42,6 +42,11 @@ func ListApplications(req *restful.Request, resp *restful.Response) {
orderBy := req.QueryParameter(params.OrderByParam)
reverse := params.ParseReverse(req)
if orderBy == "" {
orderBy = "create_time"
reverse = true
}
if err != nil {
resp.WriteHeaderAndEntity(http.StatusBadRequest, errors.Wrap(err))
return