Fix reset search_path button
authorKarl O. Pinc <kop@karlpinc.com>
Mon, 30 Sep 2024 14:29:46 +0000 (09:29 -0500)
committerKarl O. Pinc <kop@karlpinc.com>
Mon, 30 Sep 2024 14:29:46 +0000 (09:29 -0500)
src/pgwui_sql/static/sql_edit.js
src/pgwui_sql/templates/sql_edit.mak

index 6d86a3e0d29d3657dc98024d1dfe4616ff169f3c..0cbb272205da96f4841720300f24e581c194245d 100644 (file)
@@ -22,7 +22,7 @@
 */
 
 function showSearchPath() {
-  fetch('${request.route_path("pgwui_sql_db_search_path")|n}')
+  fetch(pgwuiSqlDbSearchPathRoute())
     .then((response) => {
           if (!response.ok) {
             window.alert('Problem obtaining the search_path');
index d876e8acd3cd52dda956d4cdec3a8e3d5c7c39d6..d17c5777dc91760ad335cf129f3d5d016572a4b3 100644 (file)
 
 <%inherit file="${sql_base_mak}" />
 
+<script>
+  // Functions for delivering "static" content that comes from templating.
+  function pgwuiSqlDbSearchPathRoute() {
+           return '${request.route_path("pgwui_sql_db_search_path")|n}';
+  }
+</script>
+
 <%block name="page_heading">
   SQL Entry Window
 </%block>