From 099955d3a0bd37487c6a3c0d49d2811d6e9dbe4a Mon Sep 17 00:00:00 2001 From: Gutts-n <57202549+Gutts-n@users.noreply.github.com> Date: Mon, 23 Dec 2024 11:59:34 -0300 Subject: [PATCH] [sm][fix] Adjustments on the implementation --- ckanext/nhs/helpers.py | 2 +- .../nhs/templates/package/snippets/resource_view_filters.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ckanext/nhs/helpers.py b/ckanext/nhs/helpers.py index 2965507..3676d6e 100644 --- a/ckanext/nhs/helpers.py +++ b/ckanext/nhs/helpers.py @@ -37,7 +37,7 @@ def get_datastore_resource_fields(res_id): } ) - return sorted([field['name'] for field in resource_fields.get('fields', [])]) + return sorted([field['id'] for field in resource_fields.get('fields', [])]) except (toolkit.ObjectNotFound, toolkit.NotAuthorized): pass diff --git a/ckanext/nhs/templates/package/snippets/resource_view_filters.html b/ckanext/nhs/templates/package/snippets/resource_view_filters.html index a7c87ca..570b274 100644 --- a/ckanext/nhs/templates/package/snippets/resource_view_filters.html +++ b/ckanext/nhs/templates/package/snippets/resource_view_filters.html @@ -4,6 +4,6 @@ class="resource-view-filters" data-module="resource-view-filters-override" data-module-resource-id="{{ resource['bq_table_name'] }}" - data-module-fields="{{ h.dump_json(h.get_datastore_resource_fields(resource['id'])) }}" + data-module-fields="{{ h.dump_json(h.get_datastore_resource_fields(resource['bq_table_name'])) }}" >