Skip to content

Auto adding query into any options variable #308

Closed
@lixelv

Description

@lixelv

For some reason, when I'm giving to subscribe function some options variable, It wraps her arguments in query: {}. This is not cool, to find, that your variable was edited, when you just gave it to your function. I've fixed this by replacing options (in func) on JSON.parse(JSON.stringify(options)). May be there are more efficient way, but idk. Here is example:

let options = {
	sort: '-updated',
	expand: 'allowed,owner'
};

await pb.collection('users').subscribe('*', () => {}, options);

console.log(options);

// options = {
//     "query": {
//         "sort": "-updated",
//         "expand": "allowed,owner"
//     }
// }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions