Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(fe:FSADT1-1549): displays predictive results in Title Case #1251

Merged
merged 2 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions frontend/cypress/e2e/pages/SearchPage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ describe("Search Page", () => {
pathname: "/api/clients/search",
query: {
keyword: "*",
size: "5", // Asserts we only ask for 5 results in the predictive search
},
},
(req) => {
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/pages/SearchPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const searchKeyword = ref("");
const valid = ref(true);

const predictiveSearchUri = computed(
() => `/api/clients/search?keyword=${encodeURIComponent(searchKeyword.value)}`,
() => `/api/clients/search?size=5&keyword=${encodeURIComponent(searchKeyword.value)}`,
);

const fullSearchUri = computed(
Expand Down Expand Up @@ -123,7 +123,7 @@ const searchResultToCodeName = (searchResult: ClientSearchResult): CodeNameType
const { clientNumber, clientFullName, clientType, city, clientStatus } = searchResult;
const result = {
code: clientNumber,
name: `${clientNumber}, ${clientFullName}, ${clientType}, ${city} (${clientStatus})`,
name: `${toTitleCase(`${clientNumber}, ${clientFullName}, ${clientType}, ${city}`)} (${clientStatus})`,
};
return result;
};
Expand Down
Loading