Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use Lead Style from MP tick import instead of Style #1259

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

glassbead0
Copy link
Contributor


name: Pull request
about: Create a pull request
title: 'correctly import attemptStyle from MP tick import'
labels: ''
assignees: ''


What type of PR is this?(check all applicable)

  • refactor
  • feature
  • bug fix
  • documentation
  • optimization
  • other

Description

When importing ticks from Mountain Project, the attemptStyle field was being populated with the Style field from MP. It should use the Lead Style field instead.

Related Issues

Issue #
The issue was created in openbeta-graphql, but the code is in open-tacos.

OpenBeta/openbeta-graphql#424

What this PR achieves

When converting a MPTick to a Tick object, set attemptStyle on Tick to be the value from Lead Style on MPTick (if present).

Notes

I don't see an obvious way to write tests for this. everything in tests/ticks.ts mocks out Tick objects after the conversion from MPTick has already happened, so a new test would probably have to be more of an end-to-end tests.

@Vichy97
Copy link
Contributor

Vichy97 commented Jan 23, 2025

Should we also coerce imported fields from MP into the set of possible values defined in OpenBeta/openbeta-graphql#444? That could also be a separate PR, but it is necessary in order to make the change to allowable types

set style and attemptType to null instead of N/A if absent
@glassbead0
Copy link
Contributor Author

Update: I allowed null for both style and attemptType. The test pass, but i'm not sure if there's anywhere else in the codebase that needs updating to allow null values for these 2 fields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants