Skip to content

Commit

Permalink
chore(elastic-upgrade): clean up returns and any type
Browse files Browse the repository at this point in the history
  • Loading branch information
makelicious committed Jul 17, 2024
1 parent 01ea505 commit 7dd9e81
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
3 changes: 1 addition & 2 deletions packages/migration/src/utils/elasticsearch-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,8 @@ export const updateComposition = async (
)
} catch (e) {
console.error(`updateComposition: error: ${e}`)
return
}

return
}

export const renameField = async (
Expand Down
2 changes: 1 addition & 1 deletion packages/search/src/features/search/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export async function getStatusWiseRegistrationCountHandler(
}

const response = await client.search<
any,
SearchDocument,
{
statusCounts: {
buckets: Array<{
Expand Down
8 changes: 3 additions & 5 deletions packages/search/src/features/search/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ export const advancedSearch = async (
payload: ISearchCriteria
) => {
const formattedParams = await formatSearchParams(payload, isExternalSearch)
let response

try {
response = await client.search(formattedParams, {
return await client.search(formattedParams, {
ignore: !isExternalSearch ? [404] : undefined,
meta: true
})
Expand All @@ -71,8 +71,6 @@ export const advancedSearch = async (
} else {
logger.error('Search error: ', error)
}
return undefined
return
}

return response
}

0 comments on commit 7dd9e81

Please sign in to comment.