Skip to content

Commit 9c74129

Browse files
committed
fixing listings
1 parent 33120eb commit 9c74129

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

lib/services/storage/listingsStorage.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,10 @@ export const queryListings = ({
213213
params.userId = userId || '__NO_USER__';
214214
// user scoping (non-admin only): restrict to listings whose job belongs to user
215215
if (!isAdmin) {
216-
whereParts.push(`(j.user_id = @userId)`);
216+
// Include listings from jobs owned by the user or jobs shared with the user
217+
whereParts.push(
218+
`(j.user_id = @userId OR EXISTS (SELECT 1 FROM json_each(j.shared_with_user) AS sw WHERE sw.value = @userId))`,
219+
);
217220
}
218221
if (freeTextFilter && String(freeTextFilter).trim().length > 0) {
219222
params.filter = `%${String(freeTextFilter).trim()}%`;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "fredy",
3-
"version": "14.2.0",
3+
"version": "14.2.1",
44
"description": "[F]ind [R]eal [E]states [d]amn eas[y].",
55
"scripts": {
66
"prepare": "husky",

0 commit comments

Comments
 (0)