Skip to content

Commit

Permalink
Refactor getParams helper to return empty string if q doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
Adamik10 committed Apr 23, 2024
1 parent 373a047 commit 095abf1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/utils/helpers/general.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,10 @@ export const convertPostIdsToFaustIds = (postIds: Pid[]) => {
export const getParams = (props: Record<string, string | undefined>) =>
Object.entries(props).reduce<Record<string, string>>(
(acc, [property, value]) => {
const paramValue = value || getUrlQueryParam(property);
return {
...acc,
[property]: String(value || getUrlQueryParam(property))
[property]: paramValue ? String(paramValue) : ""
};
},
{}
Expand Down

0 comments on commit 095abf1

Please sign in to comment.