Skip to content

Commit

Permalink
fix(Layout): convert boolean true/false for omits to string (#12)
Browse files Browse the repository at this point in the history
* fix(Layout): convert boolean true/false for omits to the required "true" or "false" strings

* fix(Layout): simplified Query type and omit string conversion

* fix(Layout): removed comment
  • Loading branch information
Smef authored May 3, 2024
1 parent f9cccf9 commit 89c9f3f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,10 @@ export default class Layout<T extends FieldData = FieldData, U extends GenericPo
ignoreEmptyResult = false
) : Promise<GetResponse<T, U>> {
const request : Record<string, unknown> = {
query: Array.isArray(query) ? query : [query],
query: (Array.isArray(query) ? query : [query]).map(query => ({
...query,
omit: query.omit?.toString(),
})),
};

for (const [key, value] of Object.entries(params)) {
Expand Down

0 comments on commit 89c9f3f

Please sign in to comment.