diff --git a/changelog/unreleased/fix-unrestricted-quota.md b/changelog/unreleased/fix-unrestricted-quota.md new file mode 100644 index 000000000..932a62b71 --- /dev/null +++ b/changelog/unreleased/fix-unrestricted-quota.md @@ -0,0 +1,5 @@ +Bugfix: Fix unrestricted quota on the graphAPI + +Unrestricted quota needs to show 0 on the API. It is not good for clients when the property is missing. + +https://github.com/owncloud/ocis/pull/4363 diff --git a/services/graph/pkg/service/v0/drives.go b/services/graph/pkg/service/v0/drives.go index ca823ac8e..a704c8ab0 100644 --- a/services/graph/pkg/service/v0/drives.go +++ b/services/graph/pkg/service/v0/drives.go @@ -640,16 +640,15 @@ func (g Graph) getDriveQuota(ctx context.Context, space *storageprovider.Storage } used := int64(res.UsedBytes) + total := int64(res.TotalBytes) qta := libregraph.Quota{ Remaining: &remaining, Used: &used, + Total: &total, } var t int64 - if total := int64(res.TotalBytes); total != 0 { - - // A quota was set - qta.Total = &total + if total != 0 { t = total } else { // Quota was not set