diff --git a/internal/controller/submissions.go b/internal/controller/submissions.go index b8702e4..f7ad849 100644 --- a/internal/controller/submissions.go +++ b/internal/controller/submissions.go @@ -5,10 +5,8 @@ import ( "fmt" "git.itzana.me/strafesnet/maps-service/internal/datastore" "git.itzana.me/strafesnet/maps-service/internal/model" - "git.itzana.me/strafesnet/go-grpc/maps" + "git.itzana.me/strafesnet/maps-service/api" "github.com/pkg/errors" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" "time" ) @@ -17,8 +15,8 @@ type Maps struct { Store datastore.Datastore } -func (m Maps) Get(ctx context.Context, message *maps.IdMessage) (*maps.MapResponse, error) { - item, err := m.Store.Maps().Get(ctx, message.GetID()) +func (m Maps) Get(ctx context.Context, params *api.GetSubmissionParams) (*api.Submission, error) { + item, err := m.Store.Maps().Get(ctx, params.SubmissionID) if err != nil { if err == datastore.ErrNotExist { return nil, status.Error(codes.NotFound, "map does not exit") diff --git a/server.go b/server.go index 80c472c..dd2dd5b 100644 --- a/server.go +++ b/server.go @@ -17,7 +17,7 @@ type apiServer struct { // GetUserRank implements api.Handler. func (m *apiServer) GetSubmission(ctx context.Context, params api.GetSubmissionParams) (*api.Submission, error) { - return m.submissions.Get(params.SubmissionID) + return m.submissions.Get(ctx,params) } // NewError implements api.Handler.