fix: send null for empty edited_at in mastodon api

This commit is contained in:
Sugar🍬🍭🏳️‍⚧ 2024-04-01 20:17:53 +02:00 committed by Sugar
parent 126248e58d
commit 023e2cad73

View file

@ -83,7 +83,7 @@ export class MastoConverters {
} }
return 'unknown'; return 'unknown';
} }
public encodeFile(f: any): Entity.Attachment { public encodeFile(f: any): Entity.Attachment {
return { return {
id: f.id, id: f.id,
@ -279,7 +279,8 @@ export class MastoConverters {
emoji_reactions: status.emoji_reactions, emoji_reactions: status.emoji_reactions,
bookmarked: false, bookmarked: false,
quote: isQuote ? await this.convertReblog(status.reblog) : 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,
}); });
} }
} }