You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been thinking about the "Add A Task" form and how to handle it offline.
We could simply disable (or completely hide) the form when the navigator tells us we're offline. It's crude and basic, but would get rid of the error when we try to post.
Better would be to defer the POST. First, we'd need to refactor the submit button to a javascript call that does the submit. If it failed, we could cache the POST request and send it in the background. I have no idea how to do that, but it seems possible.
Continuing to brainstorm, though, instead of the background process submitting the POST request to the controller endpoint as we would with a regular form submit, we could submit it to an API Platform endpoint. While this is somewhat more complicated to set up, it would mean that we were using the server to generate mostly static HTML and using the API for anything involving data. This seems like it'd be the better way to create dynamic apps.
There was a SymfonyCast tutorial a few years ago that walked through this, though it didn't use API Platform at the time.
The text was updated successfully, but these errors were encountered:
I've been thinking about the "Add A Task" form and how to handle it offline.
We could simply disable (or completely hide) the form when the navigator tells us we're offline. It's crude and basic, but would get rid of the error when we try to post.
Better would be to defer the POST. First, we'd need to refactor the submit button to a javascript call that does the submit. If it failed, we could cache the POST request and send it in the background. I have no idea how to do that, but it seems possible.
Continuing to brainstorm, though, instead of the background process submitting the POST request to the controller endpoint as we would with a regular form submit, we could submit it to an API Platform endpoint. While this is somewhat more complicated to set up, it would mean that we were using the server to generate mostly static HTML and using the API for anything involving data. This seems like it'd be the better way to create dynamic apps.
There was a SymfonyCast tutorial a few years ago that walked through this, though it didn't use API Platform at the time.
The text was updated successfully, but these errors were encountered: