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

Support custom model endpoints #125

Merged
merged 3 commits into from
Sep 2, 2022
Merged

Support custom model endpoints #125

merged 3 commits into from
Sep 2, 2022

Conversation

safo6m
Copy link
Member

@safo6m safo6m commented Aug 31, 2022

An additional way of providing model endpoints is implemented, HalModel.modelEndpoints, wiki

  • modelEndpoints: ModelEndpoints
    • used for building resource URLs instead of endpoint
    • readonly
    • if provided, singleResourceEndpoint is used when:
      • fetching a resource via the findOne method
      • updating a resource via the update method
    • if provided, collectionEndpoint is used when:
      • fetching resources via the find method
      • creating a resource
    • both singleResourceEndpoint and collectionEndpoint support templated strings
      • templated parts of an URL will be replaced with requestOptions.params and requestOptions.routeParams
        • the difference between the two is that routeParams won't be sent in a request payload, they are used only for building templated URL

@safo6m safo6m marked this pull request as ready for review September 2, 2022 14:36
@safo6m safo6m merged commit 5437170 into master Sep 2, 2022
@safo6m safo6m deleted the support-custom-model-urls branch September 2, 2022 14:37
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.

1 participant