Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove rest of page limit #5429

Draft
wants to merge 136 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
136 commits
Select commit Hold shift + click to select a range
5ca40a7
migration
Nutomic Feb 7, 2025
a3b835f
update code
Nutomic Feb 7, 2025
549e51f
tests
Nutomic Feb 7, 2025
43ef0b5
triggers
Nutomic Feb 7, 2025
2ea59bf
Merge branch 'main' into remove-aggregate-tables
Nutomic Feb 7, 2025
31cbe18
fix
Nutomic Feb 7, 2025
cd29e85
fmt
Nutomic Feb 7, 2025
61c5038
clippy
Nutomic Feb 7, 2025
b27aea0
post aggregate migration
Nutomic Feb 7, 2025
bb4bfe3
changes for post aggregate code
Nutomic Feb 10, 2025
17d8d98
wip: update tests for post aggregate
Nutomic Feb 10, 2025
4124f03
format
Nutomic Feb 10, 2025
c9aaaf0
fix partialeq
Nutomic Feb 10, 2025
068aded
Merge branch 'main' into remove-aggregate-tables
Nutomic Feb 10, 2025
a88845e
trigger fix
Nutomic Feb 10, 2025
1a1c366
fix post insert trigger
Nutomic Feb 10, 2025
af3035b
wip
Nutomic Feb 10, 2025
41112a9
reorder
Nutomic Feb 11, 2025
bb30add
fixes
Nutomic Feb 11, 2025
8cd04b4
Merge branch 'main' into remove-aggregate-tables
Nutomic Feb 11, 2025
f2d2852
Merge branch 'main' into remove-aggregate-tables
Nutomic Feb 11, 2025
794240c
community aggregate migration
Nutomic Feb 12, 2025
082cdfd
update code
Nutomic Feb 12, 2025
261c0a1
triggers
Nutomic Feb 12, 2025
f145565
person aggregate migration
Nutomic Feb 12, 2025
1ee4e63
person aggregate code
Nutomic Feb 12, 2025
f29c21d
person triggers
Nutomic Feb 12, 2025
8c92d25
test fixes
Nutomic Feb 12, 2025
707c418
fix scheduled task
Nutomic Feb 12, 2025
85fc71d
update api tests
Nutomic Feb 12, 2025
42015ab
Merge branch 'main' into remove-aggregate-tables
Nutomic Feb 12, 2025
cf86bc7
site_aggregates to local_site migration
Nutomic Feb 12, 2025
c9da44d
site_aggregates code changes
Nutomic Feb 12, 2025
7badf7c
triggers, tests
Nutomic Feb 12, 2025
ac7b305
more fixes
Nutomic Feb 12, 2025
47414e3
Merge branch 'main' into remove-aggregate-tables
Nutomic Feb 13, 2025
f732f63
Rename PersonPostAggregates to PostActions
Nutomic Feb 13, 2025
25aa10a
Merge local_user_vote_display_mode into local_user
Nutomic Feb 13, 2025
416ad1b
fix schema
Nutomic Feb 13, 2025
ad75528
Extracting pagination cursor utils into a trait.
dessalines Feb 13, 2025
2109461
Merge remote-tracking branch 'origin/main' into pagination_cursor_trait
dessalines Feb 14, 2025
40e4883
Refactoring to avoid stack overflows.
dessalines Feb 14, 2025
47b893c
Merge remote-tracking branch 'origin/main' into pagination_cursor_trait
dessalines Feb 14, 2025
9ec468f
Fixing api_common feature.
dessalines Feb 14, 2025
e9ecc92
Adding pagination for GetBannedPersons.
dessalines Feb 14, 2025
be0ad74
Starting to work on removing rest of page / limit.
dessalines Feb 14, 2025
cac1904
Issues with community pagination.
dessalines Feb 15, 2025
d96e9db
Rename the traits and paginationcursor::new
dessalines Feb 15, 2025
b0bc927
remove duplicate fields
Nutomic Feb 17, 2025
4a6a5e6
remove "aggregates" from index names
Nutomic Feb 17, 2025
4b7422a
uncomment indices
Nutomic Feb 17, 2025
f758ed8
if count = 0
Nutomic Feb 17, 2025
dc81051
Merge remote-tracking branch 'origin/main' into pagination_cursor_trait
dessalines Feb 18, 2025
902c4dd
Using combined trait.
dessalines Feb 18, 2025
1cf4a9c
Merge branch 'main' into remove-aggregate-tables
Nutomic Feb 20, 2025
e67828e
Merge remote-tracking branch 'origin/main' into pagination_cursor_trait
dessalines Feb 22, 2025
44c5990
remove commentaggregates
Nutomic Feb 25, 2025
2b7a0b3
Fix triggers in remove aggregates tables pr (#5451)
dullbananas Mar 3, 2025
a21f9a8
Merge branch 'main' into remove-aggregate-tables
Nutomic Mar 4, 2025
7e569ba
rename migration
Nutomic Mar 4, 2025
550ca17
Fix migration errors
Nutomic Mar 4, 2025
db569a6
Move community.hidden to visibility (fixes #5458)
Nutomic Mar 4, 2025
52f9848
Merge branch 'main' into remove-aggregate-tables
dessalines Mar 4, 2025
8c948fe
Merge remote-tracking branch 'origin/main' into pagination_cursor_trait
dessalines Mar 4, 2025
33e28e6
Removing empty files.
dessalines Mar 4, 2025
be0e6ce
Merge branch 'main' into remove-aggregate-tables
dessalines Mar 4, 2025
18961bf
Fixing person_saved_combined. (#5481)
dessalines Mar 4, 2025
5e1d233
Merge branch 'main' into remove-aggregate-tables
dessalines Mar 4, 2025
72176c1
Remove comment and post specific action structs. #5473
dessalines Mar 5, 2025
040a32f
Doing reports
dessalines Mar 5, 2025
3c49392
fix up migration by dropping index
Nutomic Mar 5, 2025
3eb342b
also add enum variant `LocalOnlyPublic`, rename `LocalOnly` to `Local…
Nutomic Mar 5, 2025
f4e203b
fix column order in down.sql
Nutomic Mar 5, 2025
fbb7797
wip
Nutomic Mar 5, 2025
84c342d
Moving blocks.
dessalines Mar 5, 2025
3e7064e
Adding a few more views.
dessalines Mar 6, 2025
f62554a
more wip
Nutomic Mar 6, 2025
a7b64c7
fixes
Nutomic Mar 6, 2025
7435069
migration for modlog
Nutomic Mar 6, 2025
283c62d
fix migration
Nutomic Mar 6, 2025
6e30036
Working views and schema.
dessalines Mar 7, 2025
22c45f6
Fix ts_optionals.
dessalines Mar 7, 2025
35c3aac
wip
Nutomic Mar 7, 2025
48d12a3
Merge branch 'main' into move-community-hidden
Nutomic Mar 7, 2025
e6bfe95
db_schema compiling
Nutomic Mar 7, 2025
b0bfd82
Merge remote-tracking branch 'origin/main' into remove-aggregate-tables
dessalines Mar 7, 2025
1f92a45
Merge branch 'remove-aggregate-tables' into create_actions_structs
dessalines Mar 7, 2025
79da16a
make the code compile
Nutomic Mar 7, 2025
d60506d
Merging from main.
dessalines Mar 7, 2025
e2c6323
lint
Nutomic Mar 7, 2025
08cbf00
Fixing SQL format.
dessalines Mar 7, 2025
7f170bc
fix down migration
Nutomic Mar 7, 2025
686172b
Merge branch 'main' into move-community-hidden
Nutomic Mar 7, 2025
0373f91
Fixing api tests.
dessalines Mar 7, 2025
8bf796a
Adding field comments for the actions tables.
dessalines Mar 7, 2025
8d8c7b6
Refactoring CommunityFollower to include follow_state
dessalines Mar 7, 2025
a3e0532
fix test
Nutomic Mar 10, 2025
024734e
make hidden status federate
Nutomic Mar 10, 2025
e9f666e
ts attr
Nutomic Mar 10, 2025
c05fa8d
fix
Nutomic Mar 10, 2025
7a156ca
fix api test
Nutomic Mar 10, 2025
4e4c3dc
Merge remote-tracking branch 'origin/main' into create_actions_structs
dessalines Mar 10, 2025
5a3850e
Update crates/api/src/reports/post_report/resolve.rs
dessalines Mar 10, 2025
51321ce
Addressing PR comments
dessalines Mar 10, 2025
b6bb292
Merge branch 'create_actions_structs' of https://github.com/LemmyNet/…
dessalines Mar 10, 2025
7bce52a
Fix ts export.
dessalines Mar 10, 2025
4dc096c
update api client
Nutomic Mar 11, 2025
9255706
review
Nutomic Mar 11, 2025
dca7baa
Merge remote-tracking branch 'origin/main' into create_actions_structs
dessalines Mar 11, 2025
89c8b79
Extracting filter_not_hidden_or_is_subscribed (#5497)
dessalines Mar 11, 2025
52a9af7
Merge remote-tracking branch 'origin/main' into create_actions_structs
dessalines Mar 11, 2025
a1ce416
Merge remote-tracking branch 'origin/move-community-hidden' into crea…
dessalines Mar 11, 2025
5f0603c
Remove follower_state_helper function.
dessalines Mar 12, 2025
df6df04
Cleaning up some utils functions.
dessalines Mar 12, 2025
de3e092
rename hidden to unlisted
Nutomic Mar 12, 2025
c0c7251
Merge remote-tracking branch 'origin/main' into move-community-hidden
dessalines Mar 12, 2025
d8dada7
Merge branch 'move-community-hidden' into create_actions_structs
dessalines Mar 12, 2025
0926b4c
Updating lemmy-js-client.
dessalines Mar 12, 2025
813e737
Merge remote-tracking branch 'origin/pagination_cursor_trait' into re…
dessalines Mar 12, 2025
70eca7f
Merge branch 'remove-aggregate-tables' into remove_rest_of_page_limit
dessalines Mar 12, 2025
c080303
Merge branch 'create_actions_structs' into remove_rest_of_page_limit
dessalines Mar 12, 2025
2f9cce7
Merge branch 'main' into remove_rest_of_page_limit
dessalines Mar 12, 2025
949fcb5
Fixing a few cases.
dessalines Mar 12, 2025
6ef238b
Fixing list_banned.
dessalines Mar 13, 2025
9d24adf
Starting to convert to lemmy results.
dessalines Mar 13, 2025
e3fd0db
Fixing vote_view.
dessalines Mar 14, 2025
48e9135
Close to finishing up errors.
dessalines Mar 14, 2025
5b6184f
Got compiling.
dessalines Mar 14, 2025
fb7a0a7
Remove tracing for CI.
dessalines Mar 14, 2025
e7df01f
Removing unused errors.
dessalines Mar 14, 2025
af8ed68
Merge remote-tracking branch 'origin/main' into remove_rest_of_page_l…
dessalines Mar 15, 2025
32e781d
Fixing merge from main.
dessalines Mar 15, 2025
252645d
Merge remote-tracking branch 'origin/main' into remove_rest_of_page_l…
dessalines Mar 15, 2025
5d48545
lower_name community_view sort.
dessalines Mar 18, 2025
91bb322
Syntax errors.
dessalines Mar 18, 2025
ea94432
Removing rest of Result from db_schema, db_views.
dessalines Mar 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ tokio-postgres = "0.7.13"
tokio-postgres-rustls = "0.13.0"
urlencoding = "2.1.3"
moka = { version = "0.12.10", features = ["future"] }
i-love-jesus = { version = "0.1.0" }
i-love-jesus = { version = "0.2.0" }
clap = { version = "4.5.29", features = ["derive", "env"] }
pretty_assertions = "1.4.1"
derive-new = "0.7.0"
Expand Down
6 changes: 2 additions & 4 deletions crates/api/src/comment/distinguish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use lemmy_db_schema::{
traits::Crud,
};
use lemmy_db_views::structs::{CommentView, LocalUserView};
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
use lemmy_utils::error::{LemmyErrorType, LemmyResult};

pub async fn distinguish_comment(
data: Json<DistinguishComment>,
Expand Down Expand Up @@ -49,9 +49,7 @@ pub async fn distinguish_comment(
distinguished: Some(data.distinguished),
..Default::default()
};
Comment::update(&mut context.pool(), data.comment_id, &form)
.await
.with_lemmy_type(LemmyErrorType::CouldntUpdateComment)?;
Comment::update(&mut context.pool(), data.comment_id, &form).await?;

let comment_view = CommentView::read(
&mut context.pool(),
Expand Down
29 changes: 26 additions & 3 deletions crates/api/src/comment/list_comment_likes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,31 @@ pub async fn list_comment_likes(
)
.await?;

let comment_likes =
VoteView::list_for_comment(&mut context.pool(), data.comment_id, data.page, data.limit).await?;
let cursor_data = if let Some(cursor) = &data.page_cursor {
Some(VoteView::from_comment_actions_cursor(cursor, &mut context.pool()).await?)
} else {
None
};

Ok(Json(ListCommentLikesResponse { comment_likes }))
let comment_likes = VoteView::list_for_comment(
&mut context.pool(),
data.comment_id,
cursor_data,
data.page_back,
data.limit,
)
.await?;

let next_page = comment_likes
.last()
.map(VoteView::to_comment_actions_cursor);
let prev_page = comment_likes
.first()
.map(VoteView::to_comment_actions_cursor);

Ok(Json(ListCommentLikesResponse {
comment_likes,
next_page,
prev_page,
}))
}
23 changes: 20 additions & 3 deletions crates/api/src/community/pending_follows/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ use lemmy_api_common::{
context::LemmyContext,
utils::check_community_mod_of_any_or_admin_action,
};
use lemmy_db_views::structs::{CommunityFollowerView, LocalUserView};
use lemmy_db_schema::traits::PaginationCursorBuilder;
use lemmy_db_views::structs::{CommunityFollowerView, LocalUserView, PendingFollow};
use lemmy_utils::error::LemmyResult;

pub async fn get_pending_follows_list(
Expand All @@ -15,14 +16,30 @@ pub async fn get_pending_follows_list(
check_community_mod_of_any_or_admin_action(&local_user_view, &mut context.pool()).await?;
let all_communities =
data.all_communities.unwrap_or_default() && local_user_view.local_user.admin;

let cursor_data = if let Some(cursor) = &data.page_cursor {
Some(CommunityFollowerView::from_cursor(cursor, &mut context.pool()).await?)
} else {
None
};

let items = CommunityFollowerView::list_approval_required(
&mut context.pool(),
local_user_view.person.id,
all_communities,
data.pending_only.unwrap_or_default(),
data.page,
cursor_data,
data.page_back,
data.limit,
)
.await?;
Ok(Json(ListCommunityPendingFollowsResponse { items }))

let next_page = items.last().map(PendingFollow::to_cursor);
let prev_page = items.first().map(PendingFollow::to_cursor);

Ok(Json(ListCommunityPendingFollowsResponse {
items,
next_page,
prev_page,
}))
}
9 changes: 3 additions & 6 deletions crates/api/src/local_user/add_admin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use lemmy_db_schema::{
traits::Crud,
};
use lemmy_db_views::{person::person_view::PersonQuery, structs::LocalUserView};
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
use lemmy_utils::error::LemmyResult;

pub async fn add_admin(
data: Json<AddAdmin>,
Expand All @@ -33,9 +33,7 @@ pub async fn add_admin(
}

// Make sure that the person_id added is local
let added_local_user = LocalUserView::read_person(&mut context.pool(), data.person_id)
.await
.with_lemmy_type(LemmyErrorType::ObjectNotLocal)?;
let added_local_user = LocalUserView::read_person(&mut context.pool(), data.person_id).await?;

LocalUser::update(
&mut context.pool(),
Expand All @@ -45,8 +43,7 @@ pub async fn add_admin(
..Default::default()
},
)
.await
.with_lemmy_type(LemmyErrorType::CouldntUpdateUser)?;
.await?;

// Mod tables
let form = ModAddForm {
Expand Down
8 changes: 2 additions & 6 deletions crates/api/src/local_user/ban_person.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@ use lemmy_db_schema::{
traits::Crud,
};
use lemmy_db_views::structs::{LocalUserView, PersonView};
use lemmy_utils::{
error::{LemmyErrorExt, LemmyErrorType, LemmyResult},
utils::validation::is_valid_body_field,
};
use lemmy_utils::{error::LemmyResult, utils::validation::is_valid_body_field};

pub async fn ban_from_site(
data: Json<BanPerson>,
Expand Down Expand Up @@ -53,8 +50,7 @@ pub async fn ban_from_site(
..Default::default()
},
)
.await
.with_lemmy_type(LemmyErrorType::CouldntUpdateUser)?;
.await?;

// if its a local user, invalidate logins
let local_user = LocalUserView::read_person(&mut context.pool(), person.id).await;
Expand Down
8 changes: 7 additions & 1 deletion crates/api/src/local_user/list_banned.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,18 @@ pub async fn list_banned_users(
banned_only: Some(true),
cursor_data,
limit: data.limit,
page_back: data.page_back,
..Default::default()
}
.list(&mut context.pool())
.await?;

let next_page = banned.last().map(PaginationCursorBuilder::to_cursor);
let prev_page = banned.first().map(PaginationCursorBuilder::to_cursor);

Ok(Json(BannedPersonsResponse { banned, next_page }))
Ok(Json(BannedPersonsResponse {
banned,
next_page,
prev_page,
}))
}
24 changes: 19 additions & 5 deletions crates/api/src/local_user/list_media.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use lemmy_api_common::{
context::LemmyContext,
person::{ListMedia, ListMediaResponse},
};
use lemmy_db_schema::traits::PaginationCursorBuilder;
use lemmy_db_views::structs::{LocalImageView, LocalUserView};
use lemmy_utils::error::LemmyResult;

Expand All @@ -11,14 +12,27 @@ pub async fn list_media(
context: Data<LemmyContext>,
local_user_view: LocalUserView,
) -> LemmyResult<Json<ListMediaResponse>> {
let page = data.page;
let limit = data.limit;
let cursor_data = if let Some(cursor) = &data.page_cursor {
Some(LocalImageView::from_cursor(cursor, &mut context.pool()).await?)
} else {
None
};

let images = LocalImageView::get_all_paged_by_local_user_id(
&mut context.pool(),
local_user_view.local_user.id,
page,
limit,
cursor_data,
data.page_back,
data.limit,
)
.await?;
Ok(Json(ListMediaResponse { images }))

let next_page = images.last().map(PaginationCursorBuilder::to_cursor);
let prev_page = images.first().map(PaginationCursorBuilder::to_cursor);

Ok(Json(ListMediaResponse {
images,
next_page,
prev_page,
}))
}
8 changes: 7 additions & 1 deletion crates/api/src/local_user/list_saved.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,17 @@ pub async fn list_person_saved(
type_: data.type_,
cursor_data,
page_back: data.page_back,
limit: data.limit,
}
.list(&mut context.pool(), &local_user_view)
.await?;

let next_page = saved.last().map(PaginationCursorBuilder::to_cursor);
let prev_page = saved.first().map(PaginationCursorBuilder::to_cursor);

Ok(Json(ListPersonSavedResponse { saved, next_page }))
Ok(Json(ListPersonSavedResponse {
saved,
next_page,
prev_page,
}))
}
8 changes: 7 additions & 1 deletion crates/api/src/local_user/notifications/list_inbox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,17 @@ pub async fn list_inbox(
show_bot_accounts: Some(local_user_view.local_user.show_bot_accounts),
cursor_data,
page_back: data.page_back,
limit: data.limit,
}
.list(&mut context.pool(), person_id)
.await?;

let next_page = inbox.last().map(PaginationCursorBuilder::to_cursor);
let prev_page = inbox.first().map(PaginationCursorBuilder::to_cursor);

Ok(Json(ListInboxResponse { inbox, next_page }))
Ok(Json(ListInboxResponse {
inbox,
next_page,
prev_page,
}))
}
18 changes: 5 additions & 13 deletions crates/api/src/local_user/notifications/mark_all_read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use lemmy_db_schema::source::{
private_message::PrivateMessage,
};
use lemmy_db_views::structs::LocalUserView;
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
use lemmy_utils::error::LemmyResult;

pub async fn mark_all_notifications_read(
context: Data<LemmyContext>,
Expand All @@ -16,24 +16,16 @@ pub async fn mark_all_notifications_read(
let person_id = local_user_view.person.id;

// Mark all comment_replies as read
CommentReply::mark_all_as_read(&mut context.pool(), person_id)
.await
.with_lemmy_type(LemmyErrorType::CouldntUpdateComment)?;
CommentReply::mark_all_as_read(&mut context.pool(), person_id).await?;

// Mark all comment mentions as read
PersonCommentMention::mark_all_as_read(&mut context.pool(), person_id)
.await
.with_lemmy_type(LemmyErrorType::CouldntUpdateComment)?;
PersonCommentMention::mark_all_as_read(&mut context.pool(), person_id).await?;

// Mark all post mentions as read
PersonPostMention::mark_all_as_read(&mut context.pool(), person_id)
.await
.with_lemmy_type(LemmyErrorType::CouldntUpdatePost)?;
PersonPostMention::mark_all_as_read(&mut context.pool(), person_id).await?;

// Mark all private_messages as read
PrivateMessage::mark_all_as_read(&mut context.pool(), person_id)
.await
.with_lemmy_type(LemmyErrorType::CouldntUpdatePrivateMessage)?;
PrivateMessage::mark_all_as_read(&mut context.pool(), person_id).await?;

Ok(Json(SuccessResponse::default()))
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use lemmy_db_schema::{
traits::Crud,
};
use lemmy_db_views::structs::LocalUserView;
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
use lemmy_utils::error::{LemmyErrorType, LemmyResult};

pub async fn mark_comment_mention_as_read(
data: Json<MarkPersonCommentMentionAsRead>,
Expand All @@ -31,8 +31,7 @@ pub async fn mark_comment_mention_as_read(
person_comment_mention_id,
&PersonCommentMentionUpdateForm { read },
)
.await
.with_lemmy_type(LemmyErrorType::CouldntUpdateComment)?;
.await?;

Ok(Json(SuccessResponse::default()))
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use lemmy_db_schema::{
traits::Crud,
};
use lemmy_db_views::structs::LocalUserView;
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
use lemmy_utils::error::{LemmyErrorType, LemmyResult};

pub async fn mark_post_mention_as_read(
data: Json<MarkPersonPostMentionAsRead>,
Expand All @@ -31,8 +31,7 @@ pub async fn mark_post_mention_as_read(
person_post_mention_id,
&PersonPostMentionUpdateForm { read },
)
.await
.with_lemmy_type(LemmyErrorType::CouldntUpdatePost)?;
.await?;

Ok(Json(SuccessResponse::default()))
}
5 changes: 2 additions & 3 deletions crates/api/src/local_user/notifications/mark_reply_read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use lemmy_db_schema::{
traits::Crud,
};
use lemmy_db_views::structs::LocalUserView;
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
use lemmy_utils::error::{LemmyErrorType, LemmyResult};

pub async fn mark_reply_as_read(
data: Json<MarkCommentReplyAsRead>,
Expand All @@ -27,8 +27,7 @@ pub async fn mark_reply_as_read(
comment_reply_id,
&CommentReplyUpdateForm { read },
)
.await
.with_lemmy_type(LemmyErrorType::CouldntUpdateComment)?;
.await?;

Ok(Json(SuccessResponse::default()))
}
Loading