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

Feat: Improve JS API to have .data(...) and .query(...) for easier JS development #2619

Closed
iJungleboy opened this issue Dec 4, 2021 · 0 comments
Assignees

Comments

@iJungleboy
Copy link
Contributor

I'm submitting a ...
[x] feature request

...about
[x] JS development

Current behavior

ATM you need to make API calls to the backed to retrieve data/content or queries. This uses the webApi on the sxc-instance. But it does force developers to understand more of the internals and API routes. So we wish to have something ca. like this:

var personsData = sxc.data('Persons');
var allPersons = personsData.getAll();
var iJungleboy = personsData.getOne(27);

var blogsWithCategories = sxc.query('BlogsWithCategories');
var everything = blogsWithCategories.getAll();
var categories = blogsWithCategories.getStream('Categories');

Your environment

  • 2sxc version(s): 12.11+
iJungleboy added a commit to 2sic/2sxc-ui that referenced this issue Dec 4, 2021
PagnoDunadan added a commit to 2sic/2sxc-ui that referenced this issue Dec 9, 2021
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

No branches or pull requests

2 participants