added phone for post
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user