Api admin route : SwitchDebugMode#112
Conversation
Mch0
commented
Nov 22, 2025
| Questions | Answers |
|---|---|
| Description? | Add api admin route for SwitchDebugModeCommand |
| Type? | improvement / new feature |
| BC breaks? | no |
| Deprecations? | no |
| Sponsor company | Griiv |
| How to test? | Api endpoint : /debug/toggle |
|
Hello @Mch0! This is your first pull request on ps_apiresources repository of the PrestaShop project. Thank you, and welcome to this Open Source community! |
kpodemski
left a comment
There was a problem hiding this comment.
Hello Arnaud!
Great to see your contribution there!
Please consider adding integration tests; there are some examples in other endpoints that have already been added.
There's also some commented code in your pull request. If you are still working on the PR, you can mark it as a draft 👍🏻
Hello kpodemski, Thanks for your reply, im going to do it |
|
@Mch0 some tests are red. |
|
Hello @Mch0 There are still some tests that are red. |
|
Hello @Mch0 Just a quick heads-up: reviews on pending Admin API PRs will start in the coming days. We first took some time to clarify and unify the Admin API contribution rules and ADR expectations. With that work done, the team will now review existing PRs based on those updates. Thanks for your patience. Feedback will follow directly on the PR. |
| #[ApiResource( | ||
| operations: [ | ||
| new CQRSUpdate( | ||
| uriTemplate: '/debug/toggle', |
There was a problem hiding this comment.
toggle word seems weird in this context to me.
To me, toggle action is for disable when enabled or enable when disabled, and without specify an argument.
But here, we can enable or disable debug mode with an argument in the request body.
Maybe here, just this is enough 🤔
| uriTemplate: '/debug/toggle', | |
| uriTemplate: '/debug-mode', |
and pass the enable in the body.
| public int $id; | ||
| public float $rate; | ||
| public ?float $optionalRate; | ||
| public string $enableDebugMode; |
There was a problem hiding this comment.
Maybe enableDebugMode is too obvious here.
Let's keep that simple:
| public string $enableDebugMode; | |
| public string $enable; |
What do you think?