diff --git a/lib/services/storage/listingsStorage.js b/lib/services/storage/listingsStorage.js index 47748c5..5a74bbe 100755 --- a/lib/services/storage/listingsStorage.js +++ b/lib/services/storage/listingsStorage.js @@ -213,7 +213,10 @@ export const queryListings = ({ params.userId = userId || '__NO_USER__'; // user scoping (non-admin only): restrict to listings whose job belongs to user if (!isAdmin) { - whereParts.push(`(j.user_id = @userId)`); + // Include listings from jobs owned by the user or jobs shared with the user + whereParts.push( + `(j.user_id = @userId OR EXISTS (SELECT 1 FROM json_each(j.shared_with_user) AS sw WHERE sw.value = @userId))`, + ); } if (freeTextFilter && String(freeTextFilter).trim().length > 0) { params.filter = `%${String(freeTextFilter).trim()}%`; diff --git a/package.json b/package.json index 81196e9..bb6ba7b 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fredy", - "version": "14.2.0", + "version": "14.2.1", "description": "[F]ind [R]eal [E]states [d]amn eas[y].", "scripts": { "prepare": "husky",