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

Allow Custom HTTP Methods Configuration for CRUD Actions in Sylius Resource Bundle #893

Open
julienromey opened this issue May 25, 2024 · 2 comments

Comments

@julienromey
Copy link

Title: Allow Configuration of HTTP Methods for CRUD Actions in Sylius Resource Bundle

Description:

Hello,

I'm experiencing an issue with the Sylius Resource Bundle when configuring CRUD operations. My current setup is:

my_entity:
    resource: |
        alias: my_entity
        templates: "@Templates/Folder"
        except: ['show']
    type: sylius.resource

For update actions, the my_entity_update route is restricted to GET|PUT|PATCH. However, we are sending POST requests. With Symfony 7, http_method_override will default to false, making this workaround unusable.

Suggestion:

Allow configuration of HTTP methods for CRUD actions in the resource configuration.
Reflect this configuration in the route definitions.
This enhancement will increase flexibility and compatibility with various request methods.

Thank you.

@loic425
Copy link
Member

loic425 commented May 25, 2024

Hi, thanks for reporting this. It has already been fixed but you have to use the new 1.11 beta when' using the new routing system with php attributes. Please look at the documentation in the docs directory.

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