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 certificates
content/output/* content/output/*
baseUrl.txt baseUrl.txt
content/publisherShiftStats.json
content/publisherShiftStats.json

View File

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

View File

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

View File

@ -68,8 +68,7 @@ function PublishersPage({ publishers = [] }: IProps) {
} else { } else {
similarity = 1 - (distance - lenDiff) / distance; 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; return similarity >= 0.95;
}); });
@ -191,7 +190,7 @@ function PublishersPage({ publishers = [] }: IProps) {
{renderPublishers()} {renderPublishers()}
</div> </div>
</div> </div>
</ProtectedRoute> </ProtectedRoute>
</Layout> </Layout>
); );
} }