getFirstListItem first arg is typed for unserialized filter
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: https://github.com/david-plugge/typed-pocketbase/blob/92854696b848263ad22cfdd75d00b5d7be5fc9ef/src/client.ts#L231-L236
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!
Hey, glad you enjoy it and sorry for my late reply!
Good catch, this should only happen when you pass in a filter like ['date', '>=', '2023-01-01'] as the filter methods always return a string. Feel free to create a PR :)