-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
atualizado o código de status dos delete controllers de Member, Product, Squad e User #29
base: master
Are you sure you want to change the base?
Conversation
WalkthroughAs alterações abrangem quatro controladores de exclusão diferentes no aplicativo: Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
app/Http/Controllers/Member/DeleteMemberController.php
(1 hunks)app/Http/Controllers/Product/DeleteProductController.php
(1 hunks)app/Http/Controllers/Squad/DeleteSquadController.php
(1 hunks)app/Http/Controllers/User/DeleteUserController.php
(1 hunks)
@@ -19,6 +19,6 @@ public function __invoke(string $uuid, string $memberUuid) | |||
|
|||
$member->delete(); | |||
|
|||
return response()->json(['message' => 'Membro apagado com sucesso'], 200); | |||
return response()->json(['message' => 'Membro apagado com sucesso'], 204); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Remover corpo da resposta com status 204
O código de status HTTP 204 (No Content) indica explicitamente que não deve haver corpo na resposta. Recomendo modificar para:
- return response()->json(['message' => 'Membro apagado com sucesso'], 204);
+ return response()->noContent();
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
return response()->json(['message' => 'Membro apagado com sucesso'], 204); | |
return response()->noContent(); |
'Message' => 'Produto deletado com sucesso' | ||
], 200); | ||
], 204); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Remover corpo da resposta com status 204
O código de status HTTP 204 (No Content) indica explicitamente que não deve haver corpo na resposta. Recomendo modificar para:
- return response()->json([
- 'Message' => 'Produto deletado com sucesso'
- ], 204);
+ return response()->noContent();
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
'Message' => 'Produto deletado com sucesso' | |
], 200); | |
], 204); | |
return response()->noContent(); |
@@ -35,6 +35,6 @@ public function __invoke(string $uuid) | |||
|
|||
$squad->delete(); | |||
|
|||
return response()->json(['message' => 'Squad apagada com sucesso'], 200); | |||
return response()->json(['message' => 'Squad apagada com sucesso'], 204); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Remover corpo da resposta com status 204
O código de status HTTP 204 (No Content) indica explicitamente que não deve haver corpo na resposta. Recomendo modificar para:
- return response()->json(['message' => 'Squad apagada com sucesso'], 204);
+ return response()->noContent();
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
return response()->json(['message' => 'Squad apagada com sucesso'], 204); | |
return response()->noContent(); |
'message' => 'Usuário deletado com sucesso!', | ||
], 200); | ||
], 204); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Remover corpo da resposta com status 204
O código de status HTTP 204 (No Content) indica explicitamente que não deve haver corpo na resposta. Recomendo modificar para:
- return response()->json([
- 'message' => 'Usuário deletado com sucesso!',
- ], 204);
+ return response()->noContent();
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
'message' => 'Usuário deletado com sucesso!', | |
], 200); | |
], 204); | |
return response()->noContent(); |
código de status corrigido de 200 para 204 em todos os controllers de delete
Summary by CodeRabbit
Correções de API
Melhoria de Resposta