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

atualizado o código de status dos delete controllers de Member, Product, Squad e User #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/Http/Controllers/Member/DeleteMemberController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Copy link

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.

Suggested change
return response()->json(['message' => 'Membro apagado com sucesso'], 204);
return response()->noContent();

}
}
2 changes: 1 addition & 1 deletion app/Http/Controllers/Product/DeleteProductController.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ public function __invoke(string $uuid)

return response()->json([
'Message' => 'Produto deletado com sucesso'
], 200);
], 204);
Comment on lines 34 to +35
Copy link

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.

Suggested change
'Message' => 'Produto deletado com sucesso'
], 200);
], 204);
return response()->noContent();

}
}
2 changes: 1 addition & 1 deletion app/Http/Controllers/Squad/DeleteSquadController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Copy link

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.

Suggested change
return response()->json(['message' => 'Squad apagada com sucesso'], 204);
return response()->noContent();

}
}
2 changes: 1 addition & 1 deletion app/Http/Controllers/User/DeleteUserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ public function __invoke(Request $request, string $uuid)

return response()->json([
'message' => 'Usuário deletado com sucesso!',
], 200);
], 204);
Comment on lines 41 to +42
Copy link

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.

Suggested change
'message' => 'Usuário deletado com sucesso!',
], 200);
], 204);
return response()->noContent();

}
}