🐛 Fix on cannot get messages history when channel related realm
This commit is contained in:
parent
9e25e7e6cc
commit
485f72eded
@ -14,7 +14,13 @@ func listMessage(c *fiber.Ctx) error {
|
|||||||
offset := c.QueryInt("offset", 0)
|
offset := c.QueryInt("offset", 0)
|
||||||
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())
|
||||||
} else if _, _, err := services.GetAvailableChannel(channel.ID, user); err != nil {
|
} else if _, _, err := services.GetAvailableChannel(channel.ID, user); err != nil {
|
||||||
|
@ -10,7 +10,7 @@ secret = "LtTjzAGFLshwXhN4ZD4nG5KlMv1MWcsvfv03TSZYnT1VhiAnLIZFTnHUwR0XhGgi"
|
|||||||
content = "uploads"
|
content = "uploads"
|
||||||
|
|
||||||
[debug]
|
[debug]
|
||||||
database = false
|
database = true
|
||||||
print_routes = false
|
print_routes = false
|
||||||
|
|
||||||
[identity]
|
[identity]
|
||||||
|
Loading…
Reference in New Issue
Block a user