mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Product update popups and hosted stripe integration
Summary: - Showing nudge to individual users to sign up for free team plan. - Implementing billing page to upgrade from free team to pro. - New modal with upgrade options and free team site signup. - Integrating Stripe-hosted UI for checkout and plan management. Test Plan: updated tests Reviewers: georgegevoian Reviewed By: georgegevoian Subscribers: paulfitz Differential Revision: https://phab.getgrist.com/D3456
This commit is contained in:
@@ -181,7 +181,7 @@ export async function sendReply<T>(
|
||||
result: QueryResult<T>,
|
||||
options: SendReplyOptions = {},
|
||||
) {
|
||||
const data = pruneAPIResult(result.data || null, options.allowedFields);
|
||||
const data = pruneAPIResult(result.data, options.allowedFields);
|
||||
if (shouldLogApiDetails && req) {
|
||||
const mreq = req as RequestWithLogin;
|
||||
log.rawDebug('api call', {
|
||||
@@ -196,7 +196,7 @@ export async function sendReply<T>(
|
||||
});
|
||||
}
|
||||
if (result.status === 200) {
|
||||
return res.json(data);
|
||||
return res.json(data ?? null); // can't handle undefined
|
||||
} else {
|
||||
return res.status(result.status).json({error: result.errMessage});
|
||||
}
|
||||
@@ -228,7 +228,7 @@ export function pruneAPIResult<T>(data: T, allowedFields?: Set<string>): T {
|
||||
if (key === 'connectId' && value === null) { return undefined; }
|
||||
return INTERNAL_FIELDS.has(key) ? undefined : value;
|
||||
});
|
||||
return JSON.parse(output);
|
||||
return output !== undefined ? JSON.parse(output) : undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user