generated from VLADIMIR/template
add location
This commit is contained in:
@@ -11,6 +11,13 @@ import (
|
||||
"google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
func nilIfEmpty(value string) *string {
|
||||
if value == "" {
|
||||
return nil
|
||||
}
|
||||
return &value
|
||||
}
|
||||
|
||||
func (s *server) AddGame(ctx context.Context, req *proto.AddGameReq) (*proto.AddGameRsp, error) {
|
||||
claims := ctx.Value("claims").(*processor_jwt.JWTClaims)
|
||||
if !roles.HasRole(claims, roles.Organizer) && !roles.HasRole(claims, roles.Author) {
|
||||
@@ -25,6 +32,7 @@ func (s *server) AddGame(ctx context.Context, req *proto.AddGameReq) (*proto.Add
|
||||
ctx,
|
||||
req.Name,
|
||||
req.Description,
|
||||
nilIfEmpty(req.Location),
|
||||
req.StartAt.AsTime(),
|
||||
req.ScenarioId,
|
||||
req.Format,
|
||||
@@ -148,6 +156,7 @@ func (s *server) UpdateGame(ctx context.Context, req *proto.UpdateGameReq) (*pro
|
||||
int(req.Id),
|
||||
req.Name,
|
||||
req.Description,
|
||||
nilIfEmpty(req.Location),
|
||||
req.StartAt.AsTime(),
|
||||
req.ScenarioId,
|
||||
req.Format,
|
||||
|
||||
Reference in New Issue
Block a user