Skip to content
Snippets Groups Projects

Add option to fetch individual resource with get

1 unresolved thread
  • Refactored get to accept a resource ID. If the id exists, only that resource will be fetched.
  • Refactored getCacheKey to include the resourceId if it exists. Also changed it to use named params to reduce the chance of passing in args in the wrong order and recieving an unexpected result.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
    • Not related to this PR but we should have method in the api-client to get/set cache data.

    • The cache itself must have get and set methods, so I'm not sure how necessary it would be to add additional top level methods to the class.

      That does get me thinking though - since getCachedResponse doesn't actually do anything specific to JSON:API, maybe that actually belongs on the base ApiClient class instead?

      Edited by Brian Perry
    • Please register or sign in to reply
  • Coby Sher added 1 commit

    added 1 commit

    Compare with previous version

  • Coby Sher added 1 commit

    added 1 commit

    • 79f9f749 - Fix cache key, fix type error in example

    Compare with previous version

  • Brian Perry
  • Coby Sher added 1 commit

    added 1 commit

    Compare with previous version

  • Brian Perry resolved all threads

    resolved all threads

  • Coby Sher added 6 commits

    added 6 commits

    • a66f6077 - 1 commit from branch project:canary
    • 7ac1dbe2 - Add option to fetch individual resource with get
    • 38a19a88 - Implement PR feedback:
    • cdc58401 - Fix cache key, fix type error in example
    • afd902ec - Refactor get:
    • 89944c3d - Update docs

    Compare with previous version

  • Coby Sher added 7 commits

    added 7 commits

    Compare with previous version

  • Needs a rebase, and also a changeset but beyond that this looks good to me.

  • Coby Sher added 1 commit

    added 1 commit

    Compare with previous version

  • merged

  • Please register or sign in to reply
    Loading