From b6fbdc66c1ce1ec61ebfb6fcc0351ea627a1d288 Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Wed, 22 Feb 2023 16:05:26 +0100 Subject: [chore] Deinterface processor and subprocessors (#1501) * [chore] Deinterface processor and subprocessors * expose subprocessors via function calls * missing license header --- internal/api/client/user/passwordchange.go | 2 +- internal/api/client/user/user.go | 4 ++-- internal/api/client/user/user_test.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'internal/api/client/user') diff --git a/internal/api/client/user/passwordchange.go b/internal/api/client/user/passwordchange.go index c2b5c598d..f0cfe3dd6 100644 --- a/internal/api/client/user/passwordchange.go +++ b/internal/api/client/user/passwordchange.go @@ -95,7 +95,7 @@ func (m *Module) PasswordChangePOSTHandler(c *gin.Context) { return } - if errWithCode := m.processor.UserChangePassword(c.Request.Context(), authed, form); errWithCode != nil { + if errWithCode := m.processor.User().PasswordChange(c.Request.Context(), authed.User, form.OldPassword, form.NewPassword); errWithCode != nil { apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1) return } diff --git a/internal/api/client/user/user.go b/internal/api/client/user/user.go index f09984380..1117db08f 100644 --- a/internal/api/client/user/user.go +++ b/internal/api/client/user/user.go @@ -33,10 +33,10 @@ const ( ) type Module struct { - processor processing.Processor + processor *processing.Processor } -func New(processor processing.Processor) *Module { +func New(processor *processing.Processor) *Module { return &Module{ processor: processor, } diff --git a/internal/api/client/user/user_test.go b/internal/api/client/user/user_test.go index 27058d5ca..c990abb56 100644 --- a/internal/api/client/user/user_test.go +++ b/internal/api/client/user/user_test.go @@ -41,7 +41,7 @@ type UserStandardTestSuite struct { mediaManager media.Manager federator federation.Federator emailSender email.Sender - processor processing.Processor + processor *processing.Processor storage *storage.Driver testTokens map[string]*gtsmodel.Token -- cgit v1.2.3