mirror of
https://github.com/stalwartlabs/mail-server.git
synced 2025-09-08 21:14:13 +08:00
Fix tenant quota update API
This commit is contained in:
parent
08980ac72e
commit
0dcaadb668
1 changed files with 18 additions and 14 deletions
|
@ -394,13 +394,15 @@ impl ManageDirectory for Store {
|
|||
let mut principal_quotas = Vec::new();
|
||||
|
||||
for (idx, quota) in quotas.into_iter().take(Type::MAX_ID + 2).enumerate() {
|
||||
if idx != 0 {
|
||||
principal_quotas.push(PrincipalQuota {
|
||||
quota,
|
||||
typ: Type::from_u8((idx - 1) as u8),
|
||||
});
|
||||
} else if quota != 0 {
|
||||
principal_create.quota = Some(quota);
|
||||
if quota != 0 {
|
||||
if idx != 0 {
|
||||
principal_quotas.push(PrincipalQuota {
|
||||
quota,
|
||||
typ: Type::from_u8((idx - 1) as u8),
|
||||
});
|
||||
} else {
|
||||
principal_create.quota = Some(quota);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1209,13 +1211,15 @@ impl ManageDirectory for Store {
|
|||
let mut principal_quotas = Vec::new();
|
||||
|
||||
for (idx, quota) in quotas.into_iter().enumerate() {
|
||||
if idx != 0 {
|
||||
principal_quotas.push(PrincipalQuota {
|
||||
quota,
|
||||
typ: Type::from_u8((idx - 1) as u8),
|
||||
});
|
||||
} else if quota != 0 {
|
||||
new_quota = Some(quota);
|
||||
if quota != 0 {
|
||||
if idx != 0 {
|
||||
principal_quotas.push(PrincipalQuota {
|
||||
quota,
|
||||
typ: Type::from_u8((idx - 1) as u8),
|
||||
});
|
||||
} else {
|
||||
new_quota = Some(quota);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue