Skip to content

Commit

Permalink
fix: use Lead Style from MP tick import instead of Style
Browse files Browse the repository at this point in the history
set style and attemptType to null instead of N/A if absent
  • Loading branch information
glassbead0 committed Jan 23, 2025
1 parent 970a113 commit 9826bc3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/app/api/user/bulkImportTicks/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ export interface Tick {
notes: string
climbId: string
userId: string | undefined
style: string
attemptType: string
style: string | null
attemptType: string | null
dateClimbed: Date
grade: string
source: string
Expand Down Expand Up @@ -99,8 +99,8 @@ const postHandler = async (req: NextRequest): Promise<any> => {
notes: tick.Notes,
climbId: tick.mp_id,
userId: uuid,
style: tick.Style === '' ? 'N/A' : tick.Style,
attemptType: tick.Style === '' ? 'N/A' : tick.Style,
style: tick.Style === '' ? null : tick.Style,
attemptType: tick['Lead Style'] === '' ? null : tick['Lead Style'],
dateClimbed: new Date(Date.parse(`${tick.Date}T00:00:00`)), // Date.parse without timezone specified converts date to user's present timezone.
grade: tick.Rating,
source: 'MP'
Expand Down

0 comments on commit 9826bc3

Please sign in to comment.