added upsert to permissions
All checks were successful
Build and Push Docker Image / Build image (push) Successful in 1m40s
All checks were successful
Build and Push Docker Image / Build image (push) Successful in 1m40s
This commit is contained in:
parent
3819877919
commit
6c2c305e2d
@ -52,7 +52,7 @@ func (self *ServersAuthorizationDbHandler) AddPermissions(ctx context.Context, u
|
|||||||
"server_id": serverId,
|
"server_id": serverId,
|
||||||
},
|
},
|
||||||
).Decode(&serverPermissions)
|
).Decode(&serverPermissions)
|
||||||
if err != nil {
|
if err != nil && err != mongo.ErrNoDocuments {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -120,6 +120,7 @@ func (self *ServersAuthorizationDbHandler) SetPermissions(ctx context.Context, u
|
|||||||
"permissions": permissions,
|
"permissions": permissions,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
options.Update().SetUpsert(true),
|
||||||
)
|
)
|
||||||
|
|
||||||
return err
|
return err
|
||||||
|
Loading…
x
Reference in New Issue
Block a user