Compare commits

...

1 Commits

Author SHA1 Message Date
orangecoding
9c74129489 fixing listings 2025-10-07 21:22:29 +02:00
2 changed files with 5 additions and 2 deletions

View File

@@ -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()}%`;

View File

@@ -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",