You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Browse filesBrowse the repository at this point in the historyBrowse files
Brijesh
committed
#492 - Fix snakeCase producing wrong column name for pldAUMs/crownAUMs
The custom snakeCase function used regex /([A-Z])/g to insert underscores
before each capital letter, producing 'pld_a_u_ms' from 'pldAUMs'. The
sort-special-case check in fetchGrazingSchedulesEntries expected
'pld_au_ms', so the mismatch caused the code to use 'pld_a_u_ms' as
a database ORDER BY column name, crashing with:
column "pld_a_u_ms" does not exist
Fix: use a two-regex approach that groups consecutive uppercase letters
(/[A-Z]+(?=[A-Z][a-z])/) before splitting on camelCase boundaries
(/([a-z0-9])([A-Z])/). This produces 'pld_au_ms' and 'crown_au_ms',
matching the existing checks in grazingschedule.ts.
0 commit comments