Unify preferences under one struct

This commit is contained in:
spikecodes 2021-01-08 17:50:03 -08:00
parent b13874d0db
commit ef2f9ad12b
4 changed files with 15 additions and 21 deletions

View file

@ -24,7 +24,7 @@ pub async fn item(req: HttpRequest) -> HttpResponse {
let mut sort: String = param(&path, "sort");
// Grab default comment sort method from Cookies
let default_sort = cookie(req.to_owned(), "comment_sort");
let default_sort = cookie(&req, "comment_sort");
// If there's no sort query but there's a default sort, set sort to default_sort
if sort.is_empty() && !default_sort.is_empty() {