generated from VLADIMIR/template
fix
This commit is contained in:
@@ -248,6 +248,9 @@ func (s *server) UpdateGameMapItem(ctx context.Context, req *proto.UpdateGameMap
|
||||
return nil, status.Error(codes.InvalidArgument, "некорректный объект карты")
|
||||
}
|
||||
if err := s.mapRepo.Update(ctx, game_map_repo.Item{GameID: int(req.GameId), Kind: req.Kind, ItemID: int(req.ItemId), X: int(req.X), Y: int(req.Y), Hidden: req.Hidden}); err != nil {
|
||||
if errors.Is(err, game_map_repo.ErrItemNotFound) {
|
||||
return nil, status.Error(codes.NotFound, "объект карты не найден")
|
||||
}
|
||||
return nil, status.Error(codes.Internal, "не удалось изменить карту")
|
||||
}
|
||||
return &proto.UpdateGameMapItemRsp{}, nil
|
||||
|
||||
Reference in New Issue
Block a user