Fix object_id unwrap error in favourite() API method

This commit is contained in:
silverpill 2022-01-13 21:29:10 +00:00
parent 1d089d4b35
commit 34ca9059b3

View file

@ -240,11 +240,11 @@ async fn favourite(
// Federate // Federate
let Audience { recipients, primary_recipient } = let Audience { recipients, primary_recipient } =
get_like_audience(db_client, &config.instance_url(), &post).await?; get_like_audience(db_client, &config.instance_url(), &post).await?;
let note_id = post.object_id.as_ref().ok_or(HttpError::InternalError)?; let note_id = post.get_object_id(&config.instance_url());
let activity = create_activity_like( let activity = create_activity_like(
&config.instance_url(), &config.instance_url(),
&current_user.profile, &current_user.profile,
note_id, &note_id,
&reaction.id, &reaction.id,
&primary_recipient, &primary_recipient,
); );