mirror of
				https://gitlab.bertha.cloud/partitio/Nextcloud-Partitio/gonextcloud
				synced 2025-11-04 05:11:46 +00:00 
			
		
		
		
	Fix quota odd behaviour
This commit is contained in:
		@@ -113,7 +113,7 @@ type Users interface {
 | 
			
		||||
	UpdateWebSite(name string, website string) error
 | 
			
		||||
	UpdateTwitter(name string, twitter string) error
 | 
			
		||||
	UpdatePassword(name string, password string) error
 | 
			
		||||
	UpdateQuota(name string, quota int) error
 | 
			
		||||
	UpdateQuota(name string, quota int64) error
 | 
			
		||||
	GroupList(name string) ([]string, error)
 | 
			
		||||
	GroupAdd(name string, group string) error
 | 
			
		||||
	GroupRemove(name string, group string) error
 | 
			
		||||
 
 | 
			
		||||
@@ -394,11 +394,11 @@ func (_m *Users) UpdatePhone(name string, phone string) error {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// UpdateQuota provides a mock function with given fields: name, quota
 | 
			
		||||
func (_m *Users) UpdateQuota(name string, quota int) error {
 | 
			
		||||
func (_m *Users) UpdateQuota(name string, quota int64) error {
 | 
			
		||||
	ret := _m.Called(name, quota)
 | 
			
		||||
 | 
			
		||||
	var r0 error
 | 
			
		||||
	if rf, ok := ret.Get(0).(func(string, int) error); ok {
 | 
			
		||||
	if rf, ok := ret.Get(0).(func(string, int64) error); ok {
 | 
			
		||||
		r0 = rf(name, quota)
 | 
			
		||||
	} else {
 | 
			
		||||
		r0 = ret.Error(0)
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,7 @@
 | 
			
		||||
package types
 | 
			
		||||
 | 
			
		||||
import "strconv"
 | 
			
		||||
 | 
			
		||||
//User encapsulate the data needed to create a new Nextcloud's User
 | 
			
		||||
type User struct {
 | 
			
		||||
	Username    string
 | 
			
		||||
@@ -38,3 +40,10 @@ type Quota struct {
 | 
			
		||||
	Relative float64 `json:"relative"`
 | 
			
		||||
	Quota    int64   `json:"quota"`
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (q *Quota) String() string {
 | 
			
		||||
	if q.Quota < 0 {
 | 
			
		||||
		return "none"
 | 
			
		||||
	}
 | 
			
		||||
	return strconv.FormatInt(q.Quota, 10)
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user