Salem B.#4
Conversation
|
PR descriptions are very useful tools for reviewers. Also very good reference for other developers and AI when you check changes in the project history. I recommend you to write the description. |
| @Configuration | ||
| public class B2Config { | ||
|
|
||
| @Value("${b2.endpoint}") private String endpoint; |
There was a problem hiding this comment.
nice that you use these values as config.
| public List<Product> getAllProducts() { | ||
| return jdbcClient | ||
| .sql("SELECT id, title, price, category, image_url FROM products") | ||
| .sql("SELECT * FROM products") |
There was a problem hiding this comment.
SELECT * grabs every column, which is problematic because:
Wastes resources — fetches data you don't need
Brittle — if columns change later, your code silently breaks
Hard to read — no one knows what data you actually need
Fix: name only the columns you use → SELECT id, name, price FROM products
Fine for quick debugging, not for production code.
| return ProductResponse.from(updatedProduct); | ||
|
|
||
| } catch (Exception e) { | ||
| throw new RuntimeException("Failed to upload product image", e); |
There was a problem hiding this comment.
Thanks @dilero, for your review and time.
Could you explain to me how I can log the exception here, to ensure next time I do it in the proper way?
No description provided.