From 694a8febab767a62f0a9e993b2991a468c319690 Mon Sep 17 00:00:00 2001 From: Nathan Stitt Date: Thu, 20 May 2021 17:20:54 -0500 Subject: [PATCH 1/2] only attempt to parse body if it's present Some api methods like onboarding say they're content type json but have empty body --- shared/src/api/request.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/shared/src/api/request.ts b/shared/src/api/request.ts index 81d8e7ee84..9199ab4106 100644 --- a/shared/src/api/request.ts +++ b/shared/src/api/request.ts @@ -87,13 +87,12 @@ async function request(methodUrl: MethodUrl, options?: any): Promise Date: Fri, 21 May 2021 10:23:21 -0500 Subject: [PATCH 2/2] use currentUser as default --- tutor/src/helpers/payments.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tutor/src/helpers/payments.tsx b/tutor/src/helpers/payments.tsx index 43f05fec05..d18489c91f 100644 --- a/tutor/src/helpers/payments.tsx +++ b/tutor/src/helpers/payments.tsx @@ -7,7 +7,7 @@ import { readonly } from 'core-decorators'; import invariant from 'invariant'; import { NotificationActions, Logging } from 'shared'; import type { Course, User } from '../models' -import { Purchase } from '../models' +import { Purchase, currentUser } from '../models' import { SUPPORT_EMAIL } from '../config' import { Chat } from './chat'; @@ -40,6 +40,7 @@ export class Payments extends BaseModel { super(); modelize(this); this.options = merge({ + user: currentUser, timeoutLength: 60000, messageHandlers: { timeout: this.onTimeout,