added phone for post

This commit is contained in:
SlimusMinus
2026-05-29 01:19:10 +03:00
parent e998666477
commit 62d55d70d0
5 changed files with 19 additions and 7 deletions

View File

@@ -41,19 +41,18 @@ public class PostService {
@CacheEvict(value = "posts", allEntries = true)
public PostRequest create(PostRequest request) {
// User user = userService.getCurrentUser();
//
Post post = mapper.toEntity(request);
post.setCreatedAt(LocalDateTime.now());
post.setStatus(PostStatus.ACTIVE);
Post savedPost = repository.save(post);
repository.save(post);
return request;
}
public List<Post> getFeed() {
return repository.findAll();
List<Post> postList = repository.findAll();
return postList;
}
@Cacheable(value = "post", key = "#id")
@@ -77,7 +76,7 @@ public class PostService {
post.setTitle(request.getTitle());
post.setDescription(request.getDescription());
post.setCategory(request.getCategory());
post.setPhone(request.getPhone());
post.setType(request.getType());
Post updated = repository.save(post);