mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-12-13 16:46:59 +00:00
parent
0a80820742
commit
23e0aff20c
@ -198,7 +198,11 @@ public class FeedRepository {
|
||||
List<Post> posts = thread.getPosts();
|
||||
// Remove the post to be deleted from the posts list
|
||||
posts = posts.stream().filter(p -> !p.getId().equals(post.getId())).collect(Collectors.toList());
|
||||
thread.withUpdatedAt(System.currentTimeMillis()).withUpdatedBy(userName).withPosts(posts);
|
||||
thread
|
||||
.withUpdatedAt(System.currentTimeMillis())
|
||||
.withUpdatedBy(userName)
|
||||
.withPosts(posts)
|
||||
.withPostsCount(posts.size());
|
||||
// update the json document
|
||||
dao.feedDAO().update(thread.getId().toString(), JsonUtils.pojoToJson(thread));
|
||||
|
||||
|
||||
@ -483,6 +483,10 @@ public class FeedResourceTest extends CatalogApplicationTest {
|
||||
// Check if get posts API returns the post
|
||||
PostList postList = listPosts(thread.getId().toString(), AUTH_HEADERS);
|
||||
assertTrue(postList.getData().isEmpty());
|
||||
|
||||
// validate posts count
|
||||
Thread getThread = getThread(thread.getId(), AUTH_HEADERS);
|
||||
assertEquals(0, getThread.getPostsCount());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user