-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* multi sweeps (wip) copy answers on create answer fixup * wip in progress * more wip in progress * rip in progress * add apis * refactor: simplify * Disallow adding answers to sweepstakes question * fix lint * fix lint * code review feedback add back admin flag for sweepify lol remove no longer necessary answers data passthrough * Remove answer duplication logic * pre-cache answers
- Loading branch information
Showing
33 changed files
with
557 additions
and
356 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { APIHandler } from './helpers/endpoint' | ||
import { getAnswer } from 'shared/supabase/answers' | ||
import { createSupabaseDirectClient } from 'shared/supabase/init' | ||
|
||
export const getSingleAnswer: APIHandler<'answer/:answerId'> = async (props) => { | ||
const pg = createSupabaseDirectClient() | ||
const answer = await getAnswer(pg, props.answerId) | ||
if (!answer) { | ||
throw new Error('Answer not found') | ||
} | ||
return answer | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { APIHandler } from './helpers/endpoint' | ||
import { getAnswersForContract } from 'shared/supabase/answers' | ||
import { createSupabaseDirectClient } from 'shared/supabase/init' | ||
|
||
export const getContractAnswers: APIHandler<'market/:contractId/answers'> = async (props) => { | ||
const pg = createSupabaseDirectClient() | ||
return await getAnswersForContract(pg, props.contractId) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.