mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-29 01:33:10 -06:00
Back to returning interface in NewInternalAPI
This commit is contained in:
parent
c7f8e6d3bb
commit
3827837d76
|
|
@ -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.
|
// can call functions directly on the returned API or via an HTTP interface using AddInternalRoutes.
|
||||||
func NewInternalAPI(
|
func NewInternalAPI(
|
||||||
accountDB accounts.Database, cfg *config.UserAPI, appServices []config.ApplicationService, keyAPI keyapi.KeyInternalAPI,
|
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)
|
deviceDB, err := devices.NewDatabase(&cfg.DeviceDatabase, cfg.Matrix.ServerName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logrus.WithError(err).Panicf("failed to connect to device db")
|
logrus.WithError(err).Panicf("failed to connect to device db")
|
||||||
|
|
|
||||||
|
|
@ -75,8 +75,8 @@ func mustMakeInternalAPI(is *is.I) (*internal.UserInternalAPI, accounts.Database
|
||||||
TemplatesPath: "../res/default",
|
TemplatesPath: "../res/default",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
apiInt := userapi.NewInternalAPI(accountDB, cfg, nil, nil).(*internal.UserInternalAPI)
|
||||||
return userapi.NewInternalAPI(accountDB, cfg, nil, nil), accountDB
|
return apiInt, accountDB
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestQueryProfile(t *testing.T) {
|
func TestQueryProfile(t *testing.T) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue