🐛 Fix cannot list channel member when it related to realm
This commit is contained in:
parent
32be79557a
commit
7e4ea47c61
@ -11,7 +11,13 @@ import (
|
|||||||
func listChannelMembers(c *fiber.Ctx) error {
|
func listChannelMembers(c *fiber.Ctx) error {
|
||||||
alias := c.Params("channel")
|
alias := c.Params("channel")
|
||||||
|
|
||||||
channel, err := services.GetChannelWithAlias(alias)
|
var err error
|
||||||
|
var channel models.Channel
|
||||||
|
if val, ok := c.Locals("realm").(models.Realm); ok {
|
||||||
|
channel, err = services.GetChannelWithAlias(alias, val.ID)
|
||||||
|
} else {
|
||||||
|
channel, err = services.GetChannelWithAlias(alias)
|
||||||
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fiber.NewError(fiber.StatusNotFound, err.Error())
|
return fiber.NewError(fiber.StatusNotFound, err.Error())
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user