Skip to content

Commit

Permalink
temp table name
Browse files Browse the repository at this point in the history
  • Loading branch information
martinheppner committed Aug 26, 2024
1 parent 36d8edf commit 762df74
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/routes/tours.js
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,14 @@ const listWrapper = async (req, res) => {
${new_filter_where_types}
${new_filter_where_languages}`;

const temp_table = `temp_`+tld+city.replace(/-/g, '_')+`_`+Date.now();

const temp_table = '';
if (!!city) {
temp_table = `temp_`+tld+city.replace(/-/g, '_')+`_`+Date.now();
}
else {
temp_table = `temp_`+tld+`_`+Date.now();
}

const temporary_sql = `CREATE TEMP TABLE ${temp_table} AS
SELECT
Expand Down Expand Up @@ -709,8 +716,13 @@ const filterWrapper = async (req, res) => {
new_search_where_searchterm = `AND t.search_column @@ websearch_to_tsquery('${postgresql_language_code}', '${search}') `
}


const temp_table = `temp_`+tld+city.replace(/-/g, '_')+`_`+Date.now();
const temp_table = '';
if (!!city) {
temp_table = `temp_`+tld+city.replace(/-/g, '_')+`_`+Date.now();
}
else {
temp_table = `temp_`+tld+`_`+Date.now();
}
// console.log("temp_table: ", temp_table)

let temporary_sql = `CREATE TEMP TABLE ${temp_table} AS
Expand Down

0 comments on commit 762df74

Please sign in to comment.