mirror of
https://github.com/spacebarchat/server.git
synced 2026-05-22 12:45:54 +00:00
Migrate Channel*Event to satisfies, part of #1577
This commit is contained in:
@@ -111,7 +111,7 @@ router.delete(
|
||||
event: "CHANNEL_UPDATE",
|
||||
data: c.toJSON(),
|
||||
channel_id: c.id,
|
||||
} as ChannelUpdateEvent),
|
||||
} satisfies ChannelUpdateEvent),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -236,7 +236,7 @@ router.patch(
|
||||
event: "CHANNEL_UPDATE",
|
||||
data: channel.toJSON(),
|
||||
channel_id,
|
||||
} as ChannelUpdateEvent),
|
||||
} satisfies ChannelUpdateEvent),
|
||||
]);
|
||||
|
||||
res.send(channel);
|
||||
|
||||
@@ -73,7 +73,7 @@ router.put(
|
||||
event: "CHANNEL_UPDATE",
|
||||
channel_id,
|
||||
data: channel.toJSON(),
|
||||
} as ChannelUpdateEvent),
|
||||
} satisfies ChannelUpdateEvent),
|
||||
]);
|
||||
|
||||
return res.sendStatus(204);
|
||||
@@ -97,7 +97,7 @@ router.delete("/:overwrite_id", route({ permission: "MANAGE_ROLES", responses: {
|
||||
event: "CHANNEL_UPDATE",
|
||||
channel_id,
|
||||
data: channel.toJSON(),
|
||||
} as ChannelUpdateEvent),
|
||||
} satisfies ChannelUpdateEvent),
|
||||
]);
|
||||
|
||||
return res.sendStatus(204);
|
||||
|
||||
@@ -62,7 +62,7 @@ router.post(
|
||||
event: "CHANNEL_UPDATE",
|
||||
data: channel.toJSON(),
|
||||
channel_id,
|
||||
} as ChannelUpdateEvent),
|
||||
} satisfies ChannelUpdateEvent),
|
||||
]);
|
||||
|
||||
res.json(channel.toJSON());
|
||||
@@ -103,7 +103,7 @@ router.put(
|
||||
event: "CHANNEL_UPDATE",
|
||||
data: channel.toJSON(),
|
||||
channel_id,
|
||||
} as ChannelUpdateEvent),
|
||||
} satisfies ChannelUpdateEvent),
|
||||
]);
|
||||
|
||||
res.json(channel.toJSON());
|
||||
@@ -142,7 +142,7 @@ router.delete(
|
||||
event: "CHANNEL_UPDATE",
|
||||
data: channel.toJSON(),
|
||||
channel_id,
|
||||
} as ChannelUpdateEvent),
|
||||
} satisfies ChannelUpdateEvent),
|
||||
]);
|
||||
|
||||
res.json(channel.toJSON());
|
||||
|
||||
@@ -123,7 +123,7 @@ router.patch(
|
||||
data: channel.toJSON(),
|
||||
channel_id: channel.id,
|
||||
guild_id,
|
||||
} as ChannelUpdateEvent);
|
||||
} satisfies ChannelUpdateEvent);
|
||||
}
|
||||
// Due to this also being able to change the order, this needs to be done in order
|
||||
// have to do the parents after the positions
|
||||
@@ -158,7 +158,7 @@ router.patch(
|
||||
data: channel.toJSON(),
|
||||
channel_id: channel.id,
|
||||
guild_id,
|
||||
} as ChannelUpdateEvent);
|
||||
} satisfies ChannelUpdateEvent);
|
||||
}
|
||||
|
||||
await Guild.update({ id: guild_id }, { channel_ordering: notMentioned });
|
||||
|
||||
@@ -292,9 +292,9 @@ export class Channel extends BaseClass {
|
||||
!opts?.skipEventEmit
|
||||
? emitEvent({
|
||||
event: "CHANNEL_CREATE",
|
||||
data: channel,
|
||||
data: ret.toJSON(),
|
||||
guild_id: channel.guild_id,
|
||||
} as ChannelCreateEvent)
|
||||
} satisfies ChannelCreateEvent)
|
||||
: Promise.resolve(),
|
||||
Guild.insertChannelInOrder(guild.id, ret.id, position, guild),
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user