Class PostSlugUpdater
java.lang.Object
com.example.blogs.app.api.post.service.PostSlugUpdater
Updates post slugs by regenerating them from the updated title when necessary.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(PostEntity post, PostUpdateRequestDTO dto) Applies slug update to a post entity if the title is being changed.
-
Constructor Details
-
PostSlugUpdater
public PostSlugUpdater()
-
-
Method Details
-
apply
Applies slug update to a post entity if the title is being changed. Generates a new slug from the title when a non-blank title is provided.- Parameters:
post- the post entity to updatedto- the update request containing the new title
-