[MM-20353] Change KVSetWithOptions to accept a byte slice (#13213)
* Drop EncodeJSON from PluginKVSetOptions * Add unit tests for KVSetWithOptions with nil values
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
3543fcce6c
Коммит
d0d6ce0a70
@@ -3698,7 +3698,7 @@ func (s *apiRPCServer) KVCompareAndDelete(args *Z_KVCompareAndDeleteArgs, return
|
||||
|
||||
type Z_KVSetWithOptionsArgs struct {
|
||||
A string
|
||||
B interface{}
|
||||
B []byte
|
||||
C model.PluginKVSetOptions
|
||||
}
|
||||
|
||||
@@ -3707,8 +3707,8 @@ type Z_KVSetWithOptionsReturns struct {
|
||||
B *model.AppError
|
||||
}
|
||||
|
||||
func (g *apiRPCClient) KVSetWithOptions(key string, newValue interface{}, options model.PluginKVSetOptions) (bool, *model.AppError) {
|
||||
_args := &Z_KVSetWithOptionsArgs{key, newValue, options}
|
||||
func (g *apiRPCClient) KVSetWithOptions(key string, value []byte, options model.PluginKVSetOptions) (bool, *model.AppError) {
|
||||
_args := &Z_KVSetWithOptionsArgs{key, value, options}
|
||||
_returns := &Z_KVSetWithOptionsReturns{}
|
||||
if err := g.client.Call("Plugin.KVSetWithOptions", _args, _returns); err != nil {
|
||||
log.Printf("RPC call to KVSetWithOptions API failed: %s", err.Error())
|
||||
@@ -3718,7 +3718,7 @@ func (g *apiRPCClient) KVSetWithOptions(key string, newValue interface{}, option
|
||||
|
||||
func (s *apiRPCServer) KVSetWithOptions(args *Z_KVSetWithOptionsArgs, returns *Z_KVSetWithOptionsReturns) error {
|
||||
if hook, ok := s.impl.(interface {
|
||||
KVSetWithOptions(key string, newValue interface{}, options model.PluginKVSetOptions) (bool, *model.AppError)
|
||||
KVSetWithOptions(key string, value []byte, options model.PluginKVSetOptions) (bool, *model.AppError)
|
||||
}); ok {
|
||||
returns.A, returns.B = hook.KVSetWithOptions(args.A, args.B, args.C)
|
||||
} else {
|
||||
|
||||
Ссылка в новой задаче
Block a user