shit
This commit is contained in:
parent
6a3d9da2e9
commit
7485729fd0
@ -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")
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user