Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exclude survey not done from method list in survey endpoint #1369

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/src/main/resources/sql/migration.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1039,7 +1039,7 @@ CREATE MATERIALIZED VIEW nrmn.ep_survey_list AS
sit.old_site_codes,
( SELECT string_agg(DISTINCT ((sm1.method_id)::character varying(3))::text, ', '::text ORDER BY ((sm1.method_id)::character varying(3))::text) AS string_agg
FROM nrmn.survey_method sm1
WHERE (sm1.survey_id = sur.survey_id)
WHERE (sm1.survey_id = sur.survey_id AND sm1.survey_not_done=false)
GROUP BY sm1.survey_id) AS methods,
sur.notes AS survey_notes
FROM ((((((((nrmn.survey sur
Expand Down
2 changes: 1 addition & 1 deletion db/endpoints/CreatePrivateEndpoints.sql
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ SELECT
sur.pq_zip_url,
sur.protection_status,
sit.old_site_codes,
(SELECT string_agg(DISTINCT sm1.method_id::varchar(3), ', ' ORDER BY sm1.method_id::varchar(3)) FROM nrmn.survey_method sm1 WHERE sm1.survey_id = sur.survey_id GROUP BY sm1.survey_id) methods,
(SELECT string_agg(DISTINCT sm1.method_id::varchar(3), ', ' ORDER BY sm1.method_id::varchar(3)) FROM nrmn.survey_method sm1 WHERE (sm1.survey_id = sur.survey_id AND sm1.survey_not_done=false) GROUP BY sm1.survey_id) methods,
sur.notes AS survey_notes
FROM nrmn.survey sur
INNER JOIN nrmn.site_ref sit1 ON sit1.site_id = sur.site_id
Expand Down
Loading