From 2c69df6c46f607890a72abbf5f00ce365d360aaf Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Tue, 24 Oct 2023 09:10:31 +0200 Subject: [PATCH] wip: compile one step further --- routers/api/v1/api.go | 2 +- services/context/repository.go | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go index 8796ae52f7..e8b8fa023c 100644 --- a/routers/api/v1/api.go +++ b/routers/api/v1/api.go @@ -837,7 +837,7 @@ func Routes() *web.Route { m.Group("/repository-id/{repsitory-id}", func() { m.Get("", activitypub.Repository) m.Post("/inbox", activitypub.ReqHTTPSignature(), activitypub.RepositoryInbox) - }, context_service.RepositoryAssignmentAPI()) + }, context_service.RepositoryIDAssignmentAPI()) }, tokenRequiresScopes(auth_model.AccessTokenScopeCategoryActivityPub)) } diff --git a/services/context/repository.go b/services/context/repository.go index 74c60f4715..b886e7e0df 100644 --- a/services/context/repository.go +++ b/services/context/repository.go @@ -23,10 +23,14 @@ func RepositoryIDAssignmentAPI() func(ctx *context.APIContext) { } var err error - ctx.Repo, err = repo_model.GetRepositoryByID(ctx, repositoryID) + repository := new(context.Repository) + // TODO: does repository struct need more infos? + repository.Repository, err = repo_model.GetRepositoryByID(ctx, repositoryID) + // TODO: check & convert errors if err != nil { ctx.Error(http.StatusInternalServerError, "GetRepositoryByID", err) } + ctx.Repo = repository } }