Skip to content

Commit

Permalink
Merge pull request #29 from AplinkosMinisterija/fish-stockings_filter…
Browse files Browse the repository at this point in the history
…_fix

fix fishStocking fish filter
  • Loading branch information
DovMa authored Oct 6, 2023
2 parents e48854f + 7678444 commit d584816
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 29 deletions.
2 changes: 1 addition & 1 deletion services/fishStockings.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,7 @@ export default class FishStockingsService extends moleculer.Service {
if (filters.fishTypes) {
const filter = filters.fishTypes;
query.$raw = {
condition: `EXISTS (SELECT 1 FROM jsonb_each("fish_types") AS ft WHERE ft.value::int IN (${filter}))`,
condition: (query?.$raw ? query.$raw.condition + ' AND ' : '' ) + `EXISTS (SELECT 1 FROM jsonb_each("fish_types") AS ft WHERE ft.value::int IN (${filter}))`,
};
}

Expand Down
28 changes: 0 additions & 28 deletions services/uml.service.ts

This file was deleted.

0 comments on commit d584816

Please sign in to comment.