Skip to content

Commit

Permalink
quick fix for search endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Dec 19, 2024
1 parent 5d2df09 commit 413d7c1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion netlify/functions/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@ const SearchParams = new Archetype({
}
}).compile('SearchParams');

const uri = process.env.MONGODB_CONNECTION_STRING;

module.exports = extrovert.toNetlifyFunction(async function search(params) {
params = new SearchParams(params);
let Content;
if (conn == null) {
conn = mongoose.createConnection(config.uri);
conn = mongoose.createConnection(uri);
await conn.asPromise();
}

Expand Down

0 comments on commit 413d7c1

Please sign in to comment.