yavsc/src/Yavsc.Blogs/Controllers
Paul Schneider d2a0c263dd
All checks were successful
Dotnet build and test / build (pull_request) Successful in 9m18s
acl post: reject BlogPostId <= 0 with 400, no 500
The 2026-08-21 prod 500 on POST /api/v1/blogacl was caused by the
PostIt client sending { circleId } only — the server deserialised
into CircleAuthorizationToBlogPost with BlogPostId = default(long) = 0,
and EF Core refused the INSERT with InvalidOperationException.

The PostIt-side fix lives in b82b6722 (enrich the payload with
blogPostId). This commit is the server-side guard: validate
BlogPostId > 0 in the controller and return 400 BadRequest instead
of letting the request reach SaveChangesAsync. The same shape that
crashed on 2026-08-21 now fails fast at the validation layer.

Verified by BlogAclApiTests.PostCircleAuthorization_dosent_return_500:
sentinel that asserts 'never 500' on a payload with BlogPostId = -1.
Previously red (500 from EF Core), now green (400 from the new guard).
2026-08-21 22:08:05 +01:00
..
BlogAclApiController.cs acl post: reject BlogPostId <= 0 with 400, no 500 2026-08-21 22:08:05 +01:00
BlogApiController.cs refacto API prefix + nav.back 2026-08-20 20:50:52 +01:00
BlogTagsApiController.cs refacto API prefix + nav.back 2026-08-20 20:50:52 +01:00
CircleApiController.cs refacto API prefix + nav.back 2026-08-20 20:50:52 +01:00
CommentsApiController.cs refacto API prefix + nav.back 2026-08-20 20:50:52 +01:00
FileSystemApiController.cs refacto API prefix + nav.back 2026-08-20 20:50:52 +01:00
FileSystemStreamController.cs refacto API prefix + nav.back 2026-08-20 20:50:52 +01:00
PostTagsApiController.cs refacto API prefix + nav.back 2026-08-20 20:50:52 +01:00
TagsApiController.cs refacto API prefix + nav.back 2026-08-20 20:50:52 +01:00
UserSearchApiController.cs refacto API prefix + nav.back 2026-08-20 20:50:52 +01:00