Migrate ChannelRecipient*Event to satisfies, part of #1577

This commit is contained in:
Rory&
2026-03-08 16:30:59 +01:00
parent 0aa1c7c5b7
commit 76f060d656
4 changed files with 11 additions and 9 deletions

View File

@@ -61,13 +61,15 @@ router.put(
event: "CHANNEL_RECIPIENT_ADD",
data: {
channel_id: channel_id,
user: await User.findOneOrFail({
where: { id: user_id },
select: PublicUserProjection,
}),
user: (
await User.findOneOrFail({
where: { id: user_id },
select: PublicUserProjection,
})
).toPublicUser(),
},
channel_id: channel_id,
} as ChannelRecipientAddEvent);
} satisfies ChannelRecipientAddEvent);
return res.sendStatus(204);
}
},

View File

@@ -104,7 +104,7 @@ router.post(
channel_id: channel.id,
},
channel_id: channel.id,
} as ChannelRecipientRemoveEvent);
} satisfies ChannelRecipientRemoveEvent);
console.log(`[Instance ban] Removed user ${user.id} from group channel ${channel.id}`);
}

View File

@@ -549,7 +549,7 @@ export class Channel extends BaseClass {
}),
},
channel_id: channel.id,
} as ChannelRecipientRemoveEvent);
} satisfies ChannelRecipientRemoveEvent);
}
static async deleteChannel(channel: Channel) {

View File

@@ -190,7 +190,7 @@ export interface ChannelRecipientAddEvent extends Event {
event: "CHANNEL_RECIPIENT_ADD";
data: {
channel_id: string;
user: User;
user: PublicUser;
};
}
@@ -198,7 +198,7 @@ export interface ChannelRecipientRemoveEvent extends Event {
event: "CHANNEL_RECIPIENT_REMOVE";
data: {
channel_id: string;
user: User;
user: PublicUser;
};
}