BLOG-126 Post management (list and create) #139

Merged
squid merged 10 commits from BLOG-126_post_management into main 2025-10-15 04:21:15 +08:00
Owner

Description

  • As the title

Package Changes

No response

Screenshots

Scenario Screenshot
Posts list 截圖 2025-10-15 凌晨4.09.28.png
Empty input 截圖 2025-10-15 凌晨4.10.12.png
Pattern not matched 截圖 2025-10-15 凌晨4.11.05.png

Reference

Resolve #126.

Checklist

  • A milestone is set
  • The related issuse has been linked to this branch
### Description - As the title ### Package Changes _No response_ ### Screenshots |Scenario|Screenshot| |-|-| |Posts list|![截圖 2025-10-15 凌晨4.09.28.png](/attachments/c8ad41e8-1065-4249-90e3-977bd36031e8)| |Empty input|![截圖 2025-10-15 凌晨4.10.12.png](/attachments/c902fdc0-4287-4b5d-9b9e-63dd6a5604a6)| |Pattern not matched|![截圖 2025-10-15 凌晨4.11.05.png](/attachments/88e4fb1d-6a69-4305-a94c-bd48982bb8a5)| ### Reference Resolve #126. ### Checklist - [x] A milestone is set - [x] The related issuse has been linked to this branch
squid added this to the 0.4 milestone 2025-10-15 04:12:16 +08:00
squid added 9 commits 2025-10-15 04:12:16 +08:00
Collaborator

/improve

/improve
Collaborator

PR Code Suggestions

CategorySuggestion                                                                                                                                    Impact
Possible issue
Fix DTO schema contradiction

The preview_image_url field is defined as Option, indicating it can be null or
absent. However, it's also annotated with #[schema(required)], which creates a
contradiction in the schema definition. To align with the nullable type, remove the
#[schema(required)] attribute.

backend/feature/post/src/adapter/delivery/create_post_request_dto.rs [15-16]

-#[schema(required, format = Uri)]
+#[schema(format = Uri)]
 pub preview_image_url: Option<String>,
Suggestion importance[1-10]: 9

__

Why: The suggestion correctly identifies a contradiction between the Option<String> type and the #[schema(required)] attribute. Fixing this inconsistency is crucial for accurate schema generation and data validation.

High
## PR Code Suggestions ✨ <!-- --> <table><thead><tr><td><strong>Category</strong></td><td align=left><strong>Suggestion&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </strong></td><td align=center><strong>Impact</strong></td></tr><tbody><tr><td rowspan=1>Possible issue</td> <td> <details><summary>Fix DTO schema contradiction</summary> ___ **The <code>preview_image_url</code> field is defined as <code>Option<String></code>, indicating it can be null or <br>absent. However, it's also annotated with <code>#[schema(required)]</code>, which creates a <br>contradiction in the schema definition. To align with the nullable type, remove the <br><code>#[schema(required)]</code> attribute.** [backend/feature/post/src/adapter/delivery/create_post_request_dto.rs [15-16]](https://git.squidspirit.com/squid/blog/src/branch/BLOG-126_post_management/backend/feature/post/src/adapter/delivery/create_post_request_dto.rs#L15-L16) ```diff -#[schema(required, format = Uri)] +#[schema(format = Uri)] pub preview_image_url: Option<String>, ``` <details><summary>Suggestion importance[1-10]: 9</summary> __ Why: The suggestion correctly identifies a contradiction between the `Option<String>` type and the `#[schema(required)]` attribute. Fixing this inconsistency is crucial for accurate schema generation and data validation. </details></details></td><td align=center>High </td></tr></tr></tbody></table>
squid added 1 commit 2025-10-15 04:14:59 +08:00
fix: case sensitive rename
All checks were successful
Frontend CI / build (push) Successful in 5m42s
PR Title Check / pr-title-check (pull_request) Successful in 21s
fd9ccb9175
squid merged commit 24a98f8f70 into main 2025-10-15 04:21:15 +08:00
squid deleted branch BLOG-126_post_management 2025-10-15 04:21:15 +08:00
Sign in to join this conversation.
No description provided.