December 2019
Intermediate to advanced
598 pages
12h 21m
English
We are going to change the implementation for posting a question to use an access token from Auth0:
import { getAccessToken } from './Auth';
export const postQuestion = async ( question: PostQuestionData,): Promise<QuestionData | undefined> => { const accessToken = await getAccessToken(); try { const result = await http< PostQuestionData, QuestionDataFromServer >({ path: '/questions', method: 'post', body: question, accessToken, }); if (result.ok && result.parsedBody) { return mapQuestionFromServer(result.parsedBody); } else ...Read now
Unlock full access