Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when using tags.list() #30

Closed
plztrial4me opened this issue Aug 11, 2023 · 2 comments · Fixed by #31
Closed

Error when using tags.list() #30

plztrial4me opened this issue Aug 11, 2023 · 2 comments · Fixed by #31
Assignees
Labels
bug Something isn't working

Comments

@plztrial4me
Copy link

plztrial4me commented Aug 11, 2023

final response = await client.tags.list(ListTagRequest(perPage: 20));

or

final response = await client.tags.list(ListTagRequest(search: 'apple'));

In both cases above, the following error occurs.

Unhandled exception:
type 'int' is not a subtype of type 'String' of 'value'
#0      _LinkedHashMapMixin.[]= (dart:collection-patch/compact_hash.dart)
#1      MapExtensions.addIfNotNull (package:wordpress_client/src/utilities/extensions/map_extensions.dart:14:9)
#2      ListTagRequest.build (package:wordpress_client/src/requests/list/list_tag.dart:43:9)
#3      ListOperation.list (package:wordpress_client/src/operations/list.dart:8:37)
...

so I edit following two lines in package:wordpress_client/src/requests/list/list_tag.dart, then it works.

43:      ..addIfNotNull('page', page.toString())
44:      ..addIfNotNull('per_page', perPage.toString())

please, check it.

@ArunPrakashG ArunPrakashG self-assigned this Aug 11, 2023
@ArunPrakashG ArunPrakashG added the bug Something isn't working label Aug 11, 2023
@ArunPrakashG
Copy link
Owner

@plztrial4me Hi there,
I have just pushed a new release onto pub.dev. Could you try out the latest build and let me know?
https://pub.dev/packages/wordpress_client

@plztrial4me
Copy link
Author

@plztrial4me Hi there, I have just pushed a new release onto pub.dev. Could you try out the latest build and let me know? https://pub.dev/packages/wordpress_client

Thanks! it works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants