So I have a Vue component called "EditorView.vue". This is a frontend editor, where my users can edit images (crop, resize, add effects etc.)
My editor has two steps:
Now when going from step 1 to step 2, the image will need to hit the backend, in order for my server to do the actual preprocessing of the image. The processed image is then returned back to the Vue view and served in step 2.
I've just watched the Cruddy By Design by Adam Wathan, where he talks about implementing the CRUD setup for controllers and keep the number of actions within controllers to a minimal.
I am currently stuck on how to solve this, and how to call the backend.
Let's say I have below controller:
and inside this controller, I have the basic CRUD actions.
I have below route defined:
I would then need to have methods such as
changeDPI() in my step 1, and in step 2, I would need methods such as
However, this has nothing to do with CRUD - it's custom actions to manipulate the image, that I have in my controller.
So what is the best approach to solving this? Should I treat the controllers for my editor differently than the rest?