Skip to content

getFirstListItem first arg is typed for unserialized filter #38

@gavry

Description

@gavry

Hi! Thanks for the awesome library - I much prefer it to the more popular one tbh!

getFirstListItem has typings that makes the first arg ("filter") of type Filter, but the actual method takes in a string and passes it directly to the parent service as the string. This results in an error from pocketbase where the query is incomplete/malformed (400 error).

Edit: forgot to paste reference:

getFirstListItem(filter: string, options?: SendOptions) {
return this.service.getFirstListItem(
filter,
this.prepareOptions(options)
);
}

I assume the solution is to:

  • Check if it's of type string
  • If yes, pass directly
  • If no, serialize it and pass it

Happy to open a pull request if that sounds good to you! Thanks again!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions