From 3827837d7669455cd0450bb15808618c3f0634dc Mon Sep 17 00:00:00 2001 From: Piotr Kozimor Date: Wed, 11 Aug 2021 06:03:45 +0200 Subject: [PATCH] Back to returning interface in NewInternalAPI --- userapi/userapi.go | 2 +- userapi/userapi_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/userapi/userapi.go b/userapi/userapi.go index 6d1479497..31e46800a 100644 --- a/userapi/userapi.go +++ b/userapi/userapi.go @@ -38,7 +38,7 @@ func AddInternalRoutes(router *mux.Router, intAPI api.UserInternalAPI) { // can call functions directly on the returned API or via an HTTP interface using AddInternalRoutes. func NewInternalAPI( accountDB accounts.Database, cfg *config.UserAPI, appServices []config.ApplicationService, keyAPI keyapi.KeyInternalAPI, -) *internal.UserInternalAPI { +) api.UserInternalAPI { deviceDB, err := devices.NewDatabase(&cfg.DeviceDatabase, cfg.Matrix.ServerName) if err != nil { logrus.WithError(err).Panicf("failed to connect to device db") diff --git a/userapi/userapi_test.go b/userapi/userapi_test.go index 70c7868fe..c7a68db30 100644 --- a/userapi/userapi_test.go +++ b/userapi/userapi_test.go @@ -75,8 +75,8 @@ func mustMakeInternalAPI(is *is.I) (*internal.UserInternalAPI, accounts.Database TemplatesPath: "../res/default", }, } - - return userapi.NewInternalAPI(accountDB, cfg, nil, nil), accountDB + apiInt := userapi.NewInternalAPI(accountDB, cfg, nil, nil).(*internal.UserInternalAPI) + return apiInt, accountDB } func TestQueryProfile(t *testing.T) {