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

fix(types): make typings for meta in responses v4 more specific #359

Merged

Conversation

SvenWesterlaken
Copy link
Contributor

@SvenWesterlaken SvenWesterlaken commented Sep 26, 2023

Types of changes

  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

Whenever I want to use the pagination of a find() request in combination with typescript: it gives me an typescript error as the typing of the meta key is Record<string, unknown> and will result in the pagination being of type unknown.

Added the two different ways pagination is returned as types and used them in conjunction with expendable list of [key: string]: unknown to adhere to the original typing and leave room for flexibility.

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes (if not applicable, please state why)

@benjamincanac benjamincanac changed the title fix(typings): make typings for meta in responses v4 more specific fix(type): make typings for meta in responses v4 more specific Nov 27, 2023
@benjamincanac benjamincanac changed the title fix(type): make typings for meta in responses v4 more specific fix(types): make typings for meta in responses v4 more specific Nov 27, 2023
@benjamincanac benjamincanac merged commit 199d56e into nuxt-modules:dev Nov 27, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants