map id on select
This commit is contained in:
parent
1505a99044
commit
50fb96c200
|
@ -24,9 +24,9 @@ func getDomain(ctx context.Context, w http.ResponseWriter) (domain Domain, retur
|
|||
return
|
||||
}
|
||||
if login.Superadmin {
|
||||
dbconnection.Where("id = ?", id).Find(&domain)
|
||||
dbconnection.Where(map[string]int64{"ID": id}).Find(&domain)
|
||||
} else {
|
||||
dbconnection.Where(map[string]int64{"id": id, "profil": profil.ID}).Find(&domain)
|
||||
dbconnection.Where(map[string]int64{"ID": id, "profil": profil.ID}).Find(&domain)
|
||||
}
|
||||
|
||||
if domain.ID <= 0 {
|
||||
|
|
|
@ -24,7 +24,7 @@ func getMail(ctx context.Context, w http.ResponseWriter) (mail Mail, returnerr *
|
|||
return
|
||||
}
|
||||
if login.Superadmin {
|
||||
dbconnection.Where("id = ?", id).Preload("Forwards").Find(&mail)
|
||||
dbconnection.Where(map[string]int64{"ID": id}).Preload("Forwards").Find(&mail)
|
||||
} else {
|
||||
dbconnection.Where(map[string]int64{"ID": id, "domain.profil": profil.ID}).Preload("Forwards").Find(&mail)
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ func getWeb(ctx context.Context, w http.ResponseWriter) (web Web, returnerr *lib
|
|||
return
|
||||
}
|
||||
if login.Superadmin {
|
||||
dbconnection.Where("id = ?", id).Preload("HTTPAccess.Login").Preload("FTPAccess.Login").Find(&web)
|
||||
dbconnection.Where(map[string]int64{"ID": id}).Preload("HTTPAccess.Login").Preload("FTPAccess.Login").Find(&web)
|
||||
} else {
|
||||
dbconnection.Where(map[string]int64{"ID": id, "domain.profil": profil.ID}).Preload("HTTPAccess.Login").Preload("FTPAccess.Login").Find(&web)
|
||||
}
|
||||
|
|
Reference in New Issue