fix publishers api

This commit is contained in:
Dobromir Popov
2024-02-27 15:33:02 +02:00
parent b1ea364663
commit 6dbf73d57a
4 changed files with 7 additions and 7 deletions

2
.gitignore vendored
View File

@ -26,3 +26,5 @@ next-cart-app.zip
certificates
content/output/*
baseUrl.txt
content/publisherShiftStats.json
content/publisherShiftStats.json

View File

@ -5,8 +5,7 @@
"html.format.wrapAttributes": "force",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": true,
// "source.organizeImports": true
"source.fixAll": "explicit"
},
"[dotenv]": {
"editor.defaultFormatter": "foxundermoon.shell-format"

View File

@ -312,8 +312,8 @@ export async function filterPublishers(selectFields, searchText, filterDate, fet
id: String(id)
}
}
const searchTextString = String(searchText).trim();
if (searchTextString) {
const searchTextString = String(searchText || "").trim();
if (searchTextString !== "") {
whereClause = {
OR: [
{ firstName: { contains: searchTextString } },

View File

@ -68,8 +68,7 @@ function PublishersPage({ publishers = [] }: IProps) {
} else {
similarity = 1 - (distance - lenDiff) / distance;
}
console.log("distance: " + distance + "; lenDiff: " + lenDiff + " similarity: " + similarity + "; " + fullName + " =? " + filter + "")
//console.log("distance: " + distance + "; lenDiff: " + lenDiff + " similarity: " + similarity + "; " + fullName + " =? " + filter + "")
return similarity >= 0.95;
});
@ -191,7 +190,7 @@ function PublishersPage({ publishers = [] }: IProps) {
{renderPublishers()}
</div>
</div>
</ProtectedRoute>
</ProtectedRoute>
</Layout>
);
}