Chore: Refactor api handlers to use web.Bind (#42199)
* Chore: Refactor api handlers to use web.Bind * fix comments * fix comment * trying to fix most of the tests and force routing.Wrap type check * fix library panels tests * fix frontend logging tests * allow passing nil as a response to skip writing * return nil instead of the response * rewrite login handler function types * remove handlerFuncCtx * make linter happy * remove old bindings from the libraryelements * restore comments
This commit is contained in:
@@ -130,8 +130,8 @@ func TestTeamAPIEndpoint(t *testing.T) {
|
||||
Logger: stub,
|
||||
}
|
||||
c.OrgRole = models.ROLE_EDITOR
|
||||
cmd := models.CreateTeamCommand{Name: teamName}
|
||||
hs.CreateTeam(c, cmd)
|
||||
c.Req.Body = mockRequestBody(models.CreateTeamCommand{Name: teamName})
|
||||
hs.CreateTeam(c)
|
||||
assert.Equal(t, createTeamCalled, 1)
|
||||
assert.Equal(t, addTeamMemberCalled, 0)
|
||||
assert.True(t, stub.warnCalled)
|
||||
@@ -146,9 +146,9 @@ func TestTeamAPIEndpoint(t *testing.T) {
|
||||
Logger: stub,
|
||||
}
|
||||
c.OrgRole = models.ROLE_EDITOR
|
||||
cmd := models.CreateTeamCommand{Name: teamName}
|
||||
c.Req.Body = mockRequestBody(models.CreateTeamCommand{Name: teamName})
|
||||
createTeamCalled, addTeamMemberCalled = 0, 0
|
||||
hs.CreateTeam(c, cmd)
|
||||
hs.CreateTeam(c)
|
||||
assert.Equal(t, createTeamCalled, 1)
|
||||
assert.Equal(t, addTeamMemberCalled, 1)
|
||||
assert.False(t, stub.warnCalled)
|
||||
|
||||
Reference in New Issue
Block a user