diff options
| author | Hazelnoot <acomputerdog@gmail.com> | 2025-04-30 11:13:46 -0400 |
|---|---|---|
| committer | Hazelnoot <acomputerdog@gmail.com> | 2025-04-30 11:13:46 -0400 |
| commit | 6e4e4fdc3335958f6eb8f35afc3e3f114fe463b8 (patch) | |
| tree | b05e5ceced12b5545f0c687d9afeac91646f211d /packages/backend/src/server/api/mastodon/MastodonConverters.ts | |
| parent | fix type errors in SponsorsService.ts (diff) | |
| download | sharkey-6e4e4fdc3335958f6eb8f35afc3e3f114fe463b8.tar.gz sharkey-6e4e4fdc3335958f6eb8f35afc3e3f114fe463b8.tar.bz2 sharkey-6e4e4fdc3335958f6eb8f35afc3e3f114fe463b8.zip | |
fix type errors in mastodon API
Diffstat (limited to 'packages/backend/src/server/api/mastodon/MastodonConverters.ts')
| -rw-r--r-- | packages/backend/src/server/api/mastodon/MastodonConverters.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/packages/backend/src/server/api/mastodon/MastodonConverters.ts b/packages/backend/src/server/api/mastodon/MastodonConverters.ts index e5d732ed79..cf625d6e94 100644 --- a/packages/backend/src/server/api/mastodon/MastodonConverters.ts +++ b/packages/backend/src/server/api/mastodon/MastodonConverters.ts @@ -4,7 +4,7 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import { Entity } from 'megalodon'; +import { Entity, MastodonEntity } from 'megalodon'; import mfm from '@transfem-org/sfm-js'; import { MastodonNotificationType } from 'megalodon/lib/src/mastodon/notification.js'; import { NotificationType } from 'megalodon/lib/src/notification.js'; @@ -275,7 +275,7 @@ export class MastodonConverters { this.getUser(p) .then(u => this.encode(u, mentionedRemoteUsers)) .catch(() => null))) - .then(p => p.filter(m => m)) as Promise<Entity.Mention[]>; + .then((p: Entity.Mention[]) => p.filter(m => m)); const tags = note.tags.map(tag => { return { @@ -327,7 +327,7 @@ export class MastodonConverters { sensitive: status.sensitive || !!cw, spoiler_text: cw, visibility: status.visibility, - media_attachments: status.media_attachments.map(a => convertAttachment(a)), + media_attachments: status.media_attachments.map((a: Entity.Account) => convertAttachment(a)), mentions: mentions, tags: tags, card: null, //FIXME @@ -345,7 +345,7 @@ export class MastodonConverters { public async convertConversation(conversation: Entity.Conversation, me: MiLocalUser | null): Promise<MastodonEntity.Conversation> { return { id: conversation.id, - accounts: await Promise.all(conversation.accounts.map(a => this.convertAccount(a))), + accounts: await Promise.all(conversation.accounts.map((a: Entity.Account) => this.convertAccount(a))), last_status: conversation.last_status ? await this.convertStatus(conversation.last_status, me) : null, unread: conversation.unread, }; |