Merge branch 'main' of ssh://git.ma-al.com:8822/goc_daniel/b2b into storage

This commit is contained in:
Daniel Goc
2026-04-08 13:19:45 +02:00
57 changed files with 1839 additions and 276 deletions

View File

@@ -22,10 +22,18 @@ func GetUserID(c fiber.Ctx) (uint, bool) {
return user_locale.User.ID, true
}
func GetOriginalUserRole(c fiber.Ctx) (model.CustomerRole, bool) {
func GetOriginalUserRole(c fiber.Ctx) (model.Role, bool) {
user_locale, ok := c.Locals(constdata.USER_LOCALE).(*model.UserLocale)
if !ok || user_locale.OriginalUser == nil {
return "", false
if !ok || user_locale.OriginalUser == nil || user_locale.OriginalUser.Role == nil {
return model.Role{}, false
}
return user_locale.OriginalUser.Role, true
return *user_locale.OriginalUser.Role, true
}
func GetCustomer(c fiber.Ctx) (*model.Customer, bool) {
user_locale, ok := c.Locals(constdata.USER_LOCALE).(*model.UserLocale)
if !ok || user_locale.User == nil {
return nil, false
}
return user_locale.User, true
}