Skip to content

Commit

Permalink
chore: cleanup threads endpoint (#324)
Browse files Browse the repository at this point in the history
  • Loading branch information
SHAcollision authored Feb 12, 2025
1 parent cd8b748 commit 45f6523
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 114 deletions.
76 changes: 0 additions & 76 deletions src/models/post/thread.rs

This file was deleted.

4 changes: 0 additions & 4 deletions src/routes/v0/endpoints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ pub const POST_DETAILS_ROUTE: &str = concatcp!(POST_ROUTE, "/details");
pub const POST_TAGS_ROUTE: &str = concatcp!(POST_ROUTE, "/tags");
pub const POST_TAGGERS_ROUTE: &str = concatcp!(POST_ROUTE, "/taggers/{label}");

// -- THREAD endpoints --
const THREAD_PREFIX: &str = concatcp!(VERSION_ROUTE, "/thread");
pub const THREAD_ROUTE: &str = concatcp!(THREAD_PREFIX, "/{author_id}/{post_id}");

// -- STREAM endpoints --
const STREAM_PREFIX: &str = concatcp!(VERSION_ROUTE, "/stream");
// STREAM of UserView objects
Expand Down
11 changes: 0 additions & 11 deletions tests/watcher/posts/reply.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,17 +174,6 @@ async fn test_homeserver_post_reply() -> Result<()> {
);

test.cleanup_post(&user_id, &reply_id).await?;
// let result_post = PostView::get_by_id(&user_id, &post_id, None, None, None)
// .await
// .unwrap();

// assert!(result_post.is_none(), "The post should have been deleted");

// After deletion, fetch the post thread again and confirm the reply is gone
// let thread_after_deletion = PostThread::get_by_id(&user_id, &parent_id, None, 0, 10)
// .await
// .expect("Failed to fetch post thread after deletion")
// .expect("The post thread should exist after deletion");

// Cleanup
test.cleanup_user(&user_id).await?;
Expand Down
13 changes: 1 addition & 12 deletions tests/watcher/posts/reply_notification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,20 +117,9 @@ async fn test_homeserver_post_reply_notification() -> Result<()> {
panic!("Expected a REPLY notification, found something else");
}

// // TODO: Impl DEL post. Assert the reply does not exist in Nexus
// DEL post.
test.cleanup_post(&alice_id, &alice_reply_id).await?;
test.cleanup_post(&bob_id, &bob_reply_id).await?;
// let result_post = PostView::get_by_id(&user_id, &post_id, None, None, None)
// .await
// .unwrap();

// assert!(result_post.is_none(), "The post should have been deleted");

// After deletion, fetch the post thread again and confirm the reply is gone
// let thread_after_deletion = PostThread::get_by_id(&user_id, &parent_id, None, 0, 10)
// .await
// .expect("Failed to fetch post thread after deletion")
// .expect("The post thread should exist after deletion");

// Cleanup
test.cleanup_user(&alice_id).await?;
Expand Down
11 changes: 0 additions & 11 deletions tests/watcher/posts/repost_notification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,17 +126,6 @@ async fn test_homeserver_post_repost_notification() -> Result<()> {
// // TODO: Impl DEL post. Assert the reply does not exist in Nexus
test.cleanup_post(&alice_id, &alice_reply_id).await?;
test.cleanup_post(&bob_id, &bob_reply_id).await?;
// let result_post = PostView::get_by_id(&user_id, &post_id, None, None, None)
// .await
// .unwrap();

// assert!(result_post.is_none(), "The post should have been deleted");

// After deletion, fetch the post thread again and confirm the reply is gone
// let thread_after_deletion = PostThread::get_by_id(&user_id, &parent_id, None, 0, 10)
// .await
// .expect("Failed to fetch post thread after deletion")
// .expect("The post thread should exist after deletion");

// Cleanup
test.cleanup_user(&alice_id).await?;
Expand Down

0 comments on commit 45f6523

Please sign in to comment.