Skip to content
This repository was archived by the owner on Apr 11, 2019. It is now read-only.
This repository was archived by the owner on Apr 11, 2019. It is now read-only.

One resource, different REST endpoints #32

@mustela

Description

@mustela

I'm wondering if there is a way to synchronise a resource in a conditional way. Since I have resources that can be modified from different end points. For example:

Resource: Organizations

You can GET organizations doing: api.com/organizations or you can do api.com/backend/organizations, but you can't PUT api.com/organizations, you have to PUT api.com/backend/organizations

If you are a "regular" user, you will be using api.com/organizations entry point, but if you are in the backend section of the app, you will need to use api.com/backend/organizations, since more operations are allowed.

So I can only think 2 approaches for now:

  1. I could duplicate the factories and have 2 Organizations factories, one pointing to api.com and the other pointing to api.com/backend, duplicating schemas, and everything.
  2. Replace synchronizer at "runtime". I'm not sure if this possible, but if I could swap between a one of the other synchronizer when requesting the factory (or similar) I think it could work.
  3. Another?

Hope the explanation is clear enough.

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions