mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-02-22 22:21:09 +08:00
Limit tags to two and integrate post publish
This commit is contained in:
@@ -53,6 +53,9 @@ public class PostService {
|
||||
if (tagIds == null || tagIds.isEmpty()) {
|
||||
throw new IllegalArgumentException("At least one tag required");
|
||||
}
|
||||
if (tagIds.size() > 2) {
|
||||
throw new IllegalArgumentException("At most two tags allowed");
|
||||
}
|
||||
User author = userRepository.findByUsername(username)
|
||||
.orElseThrow(() -> new IllegalArgumentException("User not found"));
|
||||
Category category = categoryRepository.findById(categoryId)
|
||||
|
||||
Reference in New Issue
Block a user