"devDependencies": {
"@types/jest": "^26.0.14",
"jest": "^26.4.2",
- "lemmy-js-client": "^1.0.13",
+ "lemmy-js-client": "^1.0.14",
"node-fetch": "^2.6.1",
- "ts-jest": "^26.4.0",
+ "ts-jest": "^26.4.1",
"typescript": "^4.0.3"
}
}
resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e"
integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==
-lemmy-js-client@^1.0.13:
- version "1.0.13"
- resolved "https://registry.yarnpkg.com/lemmy-js-client/-/lemmy-js-client-1.0.13.tgz#d0e1246129ade295faeec1fb4b2c7397d6947a19"
- integrity sha512-Xz87cCswi/2pbDdApw9JIy8bDWRFGiGWO6IhehTytOAzf36dr4GYgsjTQTLjBX+s+BNYr8hE0+Sz4g9c+ynoJg==
+lemmy-js-client@^1.0.14:
+ version "1.0.14"
+ resolved "https://registry.yarnpkg.com/lemmy-js-client/-/lemmy-js-client-1.0.14.tgz#81a847dd0c7d97c83913f198717498c223dc371e"
+ integrity sha512-hiGxAnAD5RFmE8qHMBtYNNYD/UrfCZ5JzmVEH/i5Vg/v5i/ZVmebx20uWtRMmdSSy6s4GbW0w4niszLW6SaJ3Q==
leven@^3.1.0:
version "3.1.0"
dependencies:
punycode "^2.1.1"
-ts-jest@^26.4.0:
- version "26.4.0"
- resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-26.4.0.tgz#903c7827f3d3bc33efc2f91be294b164400c32e3"
- integrity sha512-ofBzoCqf6Nv/PoWb/ByV3VNKy2KJSikamOBxvR3E6eVdIw10GwAXoyvMWXXjZJK2s6S27ZE8fI+JBTnGaovl6Q==
+ts-jest@^26.4.1:
+ version "26.4.1"
+ resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-26.4.1.tgz#08ec0d3fc2c3a39e4a46eae5610b69fafa6babd0"
+ integrity sha512-F4aFq01aS6mnAAa0DljNmKr/Kk9y4HVZ1m6/rtJ0ED56cuxINGq3Q9eVAh+z5vcYKe5qnTMvv90vE8vUMFxomg==
dependencies:
"@types/jest" "26.x"
bs-logger "0.x"
q: String,
type_: String,
community_id: Option<i32>,
+ community_name: Option<String>,
sort: String,
page: Option<i64>,
limit: Option<i64>,
let limit = data.limit;
let sort = SortType::from_str(&data.sort)?;
let community_id = data.community_id;
+ let community_name = data.community_name.to_owned();
match type_ {
SearchType::Posts => {
posts = blocking(context.pool(), move |conn| {
.sort(&sort)
.show_nsfw(true)
.for_community_id(community_id)
+ .for_community_name(community_name)
.search_term(q)
.my_user_id(user_id)
.page(page)
.sort(&sort)
.show_nsfw(true)
.for_community_id(community_id)
+ .for_community_name(community_name)
.search_term(q)
.my_user_id(user_id)
.page(page)
.sort(&sort)
.show_nsfw(true)
.for_community_id(community_id)
+ .for_community_name(community_name)
.url_search(q)
.page(page)
.limit(limit)
if let Some(for_community_id) = self.for_community_id {
query = query.filter(community_id.eq(for_community_id));
- query = query.then_order_by(stickied.desc());
}
if let Some(for_community_name) = self.for_community_name {
query = query.filter(community_name.eq(for_community_name));
- query = query.then_order_by(stickied.desc());
}
if let Some(url_search) = self.url_search {
.or_filter(body.ilike(searcher));
}
+ query = query.then_order_by(stickied.desc());
+
query = match self.sort {
SortType::Active => query
.then_order_by(hot_rank_active.desc())
pub q: String,
pub type_: String,
pub community_id: Option<i32>,
+ pub community_name: Option<String>,
pub sort: String,
pub page: Option<i64>,
pub limit: Option<i64>,