I am building an app on top of Spark and have built a custom component.
I want to redirect to an index page after I save a new item to the database using the following code:
Spark.post('/events/add', this.form);
I have tried to use the following line, however, this doesn't seem to exist in the current Spark instance:
Spark.get('/events');
It would be great if someone could point me in the right direction of how to resolve this issue. I have looked at the official spark documentation and I was not able to find any information related to this.
I opened the network tab in the browser and I can see the response has been returned successfully and contains all the html from the 'events' view, however, the current page does not update.
I want to do a full redirect to the view rather than return the view in the response.
I feel like I am missing out a crucial step but I cannot seem to figure it out.
Although this doesn't feel right, I have to crack on with the rest of the app so I will come back to this and post an update so it can help others in the future.