fix attempt 2

This commit is contained in:
pixtaded 2025-06-14 23:22:49 +03:00
parent 575fa3fcb1
commit bf6c1095de
2 changed files with 3 additions and 3 deletions

View File

@ -218,7 +218,7 @@ router.patch(
await Guild.insertChannelInOrder(guild.id, channel.id, 0, guild);
guild.rules_channel_id = channel.id;
} else if (body.rules_channel_id != undefined) {
} else if (body.rules_channel_id) {
// ensure channel exists in this guild
await Channel.findOneOrFail({
where: { guild_id, id: body.rules_channel_id },

View File

@ -236,7 +236,7 @@ export class Guild extends BaseClass {
public_updates_channel_id: string;
@JoinColumn({ name: "public_updates_channel_id" })
@ManyToOne(() => Channel)
@ManyToOne(() => Channel, { nullable: true })
public_updates_channel?: Channel;
@Column({ nullable: true })
@ -244,7 +244,7 @@ export class Guild extends BaseClass {
rules_channel_id?: string;
@JoinColumn({ name: "rules_channel_id" })
@ManyToOne(() => Channel)
@ManyToOne(() => Channel, { nullable: true })
rules_channel?: string;
@Column({ nullable: true })