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

Add ApiPlatform and use stimulus for crud actions #6

Open
tacman opened this issue Mar 1, 2024 · 1 comment
Open

Add ApiPlatform and use stimulus for crud actions #6

tacman opened this issue Mar 1, 2024 · 1 comment

Comments

@tacman
Copy link
Contributor

tacman commented Mar 1, 2024

I'm excited to see a working demo!

I think it can be improved by leveraging stimulus and api platform for the crud actions. In particular, an action like "toggle" shouldn't show a 404 if it's online, but instead should attempt an AJAX call to the API, and when that returns, update the item html.

In the ideal world, actions would update a local database (IndexDB? Firebase?) and a background process would keep the data in sync. But in the short term, it could simply fail but instead of a 404 simply say "try again when you're online".

Fetching the items, too, could be an API call rather than fetching the entire page.

@Spomky
Copy link
Member

Spomky commented Mar 1, 2024

shouldn't show a 404 if it's online,

With Background Sync the requests are queued. The behavior depends on the application context.
The app could simply redirect with a message telling it will be handled later (I think Mercure or Push notifications are great for that).

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