MM-23816: Group Mentions: Add ability to rename group names (#14338)
* MM-23816: Group Mentions: Add ability to rename group names
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
9dc64173dc
Коммит
41e58d9769
@@ -490,8 +490,8 @@ type API interface {
|
||||
// GetGroupByName gets a group by name.
|
||||
//
|
||||
// @tag Group
|
||||
// Minimum server version: 5.18
|
||||
GetGroupByName(name string) (*model.Group, *model.AppError)
|
||||
// Minimum server version: 5.24
|
||||
GetGroupByName(name string, opts model.GroupSearchOpts) (*model.Group, *model.AppError)
|
||||
|
||||
// GetGroupsForUser gets the groups a user is in.
|
||||
//
|
||||
|
||||
@@ -532,9 +532,9 @@ func (api *apiTimerLayer) GetGroup(groupId string) (*model.Group, *model.AppErro
|
||||
return _returnsA, _returnsB
|
||||
}
|
||||
|
||||
func (api *apiTimerLayer) GetGroupByName(name string) (*model.Group, *model.AppError) {
|
||||
func (api *apiTimerLayer) GetGroupByName(name string, opts model.GroupSearchOpts) (*model.Group, *model.AppError) {
|
||||
startTime := timePkg.Now()
|
||||
_returnsA, _returnsB := api.apiImpl.GetGroupByName(name)
|
||||
_returnsA, _returnsB := api.apiImpl.GetGroupByName(name, opts)
|
||||
api.recordTime(startTime, "GetGroupByName", true)
|
||||
return _returnsA, _returnsB
|
||||
}
|
||||
|
||||
@@ -2559,6 +2559,7 @@ func (s *apiRPCServer) GetGroup(args *Z_GetGroupArgs, returns *Z_GetGroupReturns
|
||||
|
||||
type Z_GetGroupByNameArgs struct {
|
||||
A string
|
||||
B model.GroupSearchOpts
|
||||
}
|
||||
|
||||
type Z_GetGroupByNameReturns struct {
|
||||
@@ -2566,8 +2567,8 @@ type Z_GetGroupByNameReturns struct {
|
||||
B *model.AppError
|
||||
}
|
||||
|
||||
func (g *apiRPCClient) GetGroupByName(name string) (*model.Group, *model.AppError) {
|
||||
_args := &Z_GetGroupByNameArgs{name}
|
||||
func (g *apiRPCClient) GetGroupByName(name string, opts model.GroupSearchOpts) (*model.Group, *model.AppError) {
|
||||
_args := &Z_GetGroupByNameArgs{name, opts}
|
||||
_returns := &Z_GetGroupByNameReturns{}
|
||||
if err := g.client.Call("Plugin.GetGroupByName", _args, _returns); err != nil {
|
||||
log.Printf("RPC call to GetGroupByName API failed: %s", err.Error())
|
||||
@@ -2577,9 +2578,9 @@ func (g *apiRPCClient) GetGroupByName(name string) (*model.Group, *model.AppErro
|
||||
|
||||
func (s *apiRPCServer) GetGroupByName(args *Z_GetGroupByNameArgs, returns *Z_GetGroupByNameReturns) error {
|
||||
if hook, ok := s.impl.(interface {
|
||||
GetGroupByName(name string) (*model.Group, *model.AppError)
|
||||
GetGroupByName(name string, opts model.GroupSearchOpts) (*model.Group, *model.AppError)
|
||||
}); ok {
|
||||
returns.A, returns.B = hook.GetGroupByName(args.A)
|
||||
returns.A, returns.B = hook.GetGroupByName(args.A, args.B)
|
||||
} else {
|
||||
return encodableError(fmt.Errorf("API GetGroupByName called but not implemented."))
|
||||
}
|
||||
|
||||
@@ -1073,13 +1073,13 @@ func (_m *API) GetGroup(groupId string) (*model.Group, *model.AppError) {
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetGroupByName provides a mock function with given fields: name
|
||||
func (_m *API) GetGroupByName(name string) (*model.Group, *model.AppError) {
|
||||
ret := _m.Called(name)
|
||||
// GetGroupByName provides a mock function with given fields: name, opts
|
||||
func (_m *API) GetGroupByName(name string, opts model.GroupSearchOpts) (*model.Group, *model.AppError) {
|
||||
ret := _m.Called(name, opts)
|
||||
|
||||
var r0 *model.Group
|
||||
if rf, ok := ret.Get(0).(func(string) *model.Group); ok {
|
||||
r0 = rf(name)
|
||||
if rf, ok := ret.Get(0).(func(string, model.GroupSearchOpts) *model.Group); ok {
|
||||
r0 = rf(name, opts)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.Group)
|
||||
@@ -1087,8 +1087,8 @@ func (_m *API) GetGroupByName(name string) (*model.Group, *model.AppError) {
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
||||
r1 = rf(name)
|
||||
if rf, ok := ret.Get(1).(func(string, model.GroupSearchOpts) *model.AppError); ok {
|
||||
r1 = rf(name, opts)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
|
||||
Ссылка в новой задаче
Block a user