merge: fix: send null for empty edited_at in mastodon api (!487)

View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/487

Approved-by: Amelia Yukii <amelia.yukii@shourai.de>
This commit is contained in:
Sugar 2024-04-03 13:27:51 +00:00
commit 0911bc92ac

View file

@ -83,7 +83,7 @@ export class MastoConverters {
}
return 'unknown';
}
public encodeFile(f: any): Entity.Attachment {
return {
id: f.id,
@ -279,7 +279,8 @@ export class MastoConverters {
emoji_reactions: status.emoji_reactions,
bookmarked: false,
quote: isQuote ? await this.convertReblog(status.reblog) : false,
edited_at: note.updatedAt?.toISOString(),
// optional chaining cannot be used, as it evaluates to undefined, not null
edited_at: note.updatedAt ? note.updatedAt.toISOString() : null,
});
}
}