Skip to content

DoCurious API Reference / adapters / adaptChallengeInstance

Function: adaptChallengeInstance()

adaptChallengeInstance(sql): ChallengeInstance

Defined in: adapters/challengeAdapter.ts:167

Adapt a SQL challenge_instance row to FE ChallengeInstance type.

Maps difficulty integers (0-3) to named levels, converts tinyint booleans, and restructures address fields. Note: challengeId is the numeric FK and needs a UUID lookup in production.

Parameters

sql

SqlChallengeInstance

Raw SQL challenge_instance row

Returns

ChallengeInstance

FE ChallengeInstance

DoCurious Platform Documentation