fix fuzzy search result - to be array as well
This commit is contained in:
@ -1,7 +1,12 @@
|
||||
NODE_TLS_REJECT_UNAUTHORIZED=0
|
||||
# NODE_EXTRA_CA_CERTS=C:\\Users\\popov\\AppData\\Local\\mkcert
|
||||
|
||||
NEXT_PUBLIC_PROTOCOL=http
|
||||
NEXT_PUBLIC_HOST=localhost
|
||||
NEXT_PUBLIC_PORT=3003
|
||||
NEXTAUTH_URL=http://localhost:3003
|
||||
|
||||
SSL_ENABLED=true
|
||||
NEXT_PUBLIC_PORT=3004
|
||||
SSL_KEY=./certificates/localhost-key.pem
|
||||
SSL_CERT=./certificates/localhost.pem
|
||||
|
||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -25,3 +25,4 @@ next-cart-app.zip
|
||||
!public/uploads/thumb/
|
||||
certificates
|
||||
content/output/*
|
||||
baseUrl.txt
|
||||
|
@ -79,7 +79,6 @@ app
|
||||
}
|
||||
next();
|
||||
});
|
||||
}
|
||||
if (process.env.SSL_KEY && process.env.SSL_CERT) {
|
||||
const options = {
|
||||
key: fs.readFileSync(process.env.SSL_KEY),
|
||||
@ -88,6 +87,7 @@ app
|
||||
};
|
||||
https.createServer(options, server).listen(PORT);
|
||||
}
|
||||
}
|
||||
|
||||
// Add the middleware to set 'x-forwarded-host' header
|
||||
server.use((req, res, next) => {
|
||||
|
@ -118,7 +118,7 @@ exports.getPrismaClient = function getPrismaClient() {
|
||||
logger.debug("getPrismaClient: process.env.DATABASE_URL = ", process.env.DATABASE_URL);
|
||||
prisma = new PrismaClient({
|
||||
// Optional: Enable logging
|
||||
// log: ['query', 'info', 'warn', 'error'],
|
||||
log: ['query', 'info', 'warn', 'error'],
|
||||
datasources: { db: { url: process.env.DATABASE_URL } },
|
||||
});
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ async function findPublisher(names, email, select, getAll = false) {
|
||||
if (result.length === 0 && names) {
|
||||
console.log("No publisher found, trying fuzzy search for '" + names + "'- email: '" + email + "'");
|
||||
const publishers = await prisma.publisher.findMany();
|
||||
result = await common.fuzzySearch(publishers, names, 0.90);
|
||||
result = [await common.fuzzySearch(publishers, names, 0.90)];
|
||||
console.log("Fuzzy search result: " + result?.firstName + " " + result?.lastName + " - " + result?.email);
|
||||
}
|
||||
//always return an array
|
||||
|
Reference in New Issue
Block a user