🐛 Fix founder cannot end their own call

This commit is contained in:
LittleSheep 2024-08-05 00:05:47 +08:00
parent e15cd25c81
commit 1867ff64f7
2 changed files with 2 additions and 2 deletions

View File

@ -129,7 +129,7 @@ func endCall(c *fiber.Ctx) error {
call, err := services.GetOngoingCall(channel)
if err != nil {
return fiber.NewError(fiber.StatusNotFound, err.Error())
} else if call.FounderID != user.ID && membership.PowerLevel < 50 {
} else if call.FounderID != membership.ID && membership.PowerLevel < 50 {
return fiber.NewError(fiber.StatusBadRequest, "only call founder or channel moderator can end this call")
}

View File

@ -82,7 +82,7 @@ func NewCall(channel models.Channel, founder models.ChannelMember) (models.Call,
id := fmt.Sprintf("%s+%d", channel.Alias, channel.ID)
call := models.Call{
ExternalID: id,
FounderID: founder.AccountID,
FounderID: founder.ID,
ChannelID: channel.ID,
Founder: founder,
Channel: channel,