Wrap API Endpoints in one more abstraction layer #6260
fxmb
started this conversation in
Feature Requests
Replies: 1 comment 2 replies
-
With v2 all endpoints will call a workflow (see example) which is similar to what you are suggesting here. Additionally, workflows will over time become customizable so you can do something along the lines of this:
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to call
create-cart
from within one of my custom endpoints. Right now I either have to copy the entire logic fromcreate-cart.ts
(which is multiple hundreds lines of code) or call the endpoint from my own server (which is an anti pattern)...It would be awesome if all endpoints were wrapped in another layer of abstraction, e.g.:
would become:
All the code from the first example would be abstracted behind createCart() which could be imported throughout the code base....
Now I have to copy all the code from above to create a cart... No need to say how this is not ideal at all....
Does this make sense?
Beta Was this translation helpful? Give feedback.
All reactions