From 7485729fd0151e80a74a147046bbf93d3b029b6f Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 26 Nov 2024 14:10:30 -0800 Subject: [PATCH] shit --- internal/controller/submissions.go | 8 +++----- server.go | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) 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.