Skip to content

Commit

Permalink
Merge pull request #707 from freeCodeCamp/main
Browse files Browse the repository at this point in the history
Create a new pull request by comparing changes across two branches
  • Loading branch information
GulajavaMinistudio authored Aug 20, 2024
2 parents 36d4467 + 70be2fa commit 5d2598e
Show file tree
Hide file tree
Showing 138 changed files with 9,887 additions and 3,923 deletions.
2 changes: 1 addition & 1 deletion api/src/routes/certificate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ export const protectedCertificateRoutes: FastifyPluginCallbackTypebox = (
await fastify.sendEmail(notifyUser);
} catch (e) {
fastify.log.error(e);
// TODO: Log to Sentry
fastify.Sentry.captureException(e);
}
}

Expand Down
24 changes: 4 additions & 20 deletions api/src/routes/donate.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import {
Type,
type FastifyPluginCallbackTypebox
} from '@fastify/type-provider-typebox';
import { type FastifyPluginCallbackTypebox } from '@fastify/type-provider-typebox';
import Stripe from 'stripe';
import {
donationSubscriptionConfig,
Expand Down Expand Up @@ -62,22 +59,7 @@ export const donateRoutes: FastifyPluginCallbackTypebox = (
fastify.post(
'/donate/add-donation',
{
schema: {
body: Type.Object({}),
response: {
200: Type.Object({
isDonating: Type.Boolean()
}),
400: Type.Object({
message: Type.Literal('User is already donating.'),
type: Type.Literal('info')
}),
500: Type.Object({
message: Type.Literal('Something went wrong.'),
type: Type.Literal('danger')
})
}
}
schema: schemas.addDonation
},
async (req, reply) => {
try {
Expand Down Expand Up @@ -105,6 +87,7 @@ export const donateRoutes: FastifyPluginCallbackTypebox = (
} as const;
} catch (error) {
fastify.log.error(error);
fastify.Sentry.captureException(error);
void reply.code(500);
return {
type: 'danger',
Expand Down Expand Up @@ -231,6 +214,7 @@ export const donateRoutes: FastifyPluginCallbackTypebox = (
});
} catch (error) {
fastify.log.error(error);
fastify.Sentry.captureException(error);
void reply.code(500);
return reply.send({
error: 'Donation failed due to a server error.'
Expand Down
1 change: 1 addition & 0 deletions api/src/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export { msTrophyChallengeCompleted } from './schemas/challenge/ms-trophy-challe
export { projectCompleted } from './schemas/challenge/project-completed';
export { saveChallenge } from './schemas/challenge/save-challenge';
export { deprecatedEndpoints } from './schemas/deprecated';
export { addDonation } from './schemas/donate/add-donation';
export { chargeStripeCard } from './schemas/donate/charge-stripe-card';
export { chargeStripe } from './schemas/donate/charge-stripe';
export { createStripePaymentIntent } from './schemas/donate/create-stripe-payment-intent';
Expand Down
18 changes: 18 additions & 0 deletions api/src/schemas/donate/add-donation.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { Type } from '@fastify/type-provider-typebox';

export const addDonation = {
body: Type.Object({}),
response: {
200: Type.Object({
isDonating: Type.Boolean()
}),
400: Type.Object({
message: Type.Literal('User is already donating.'),
type: Type.Literal('info')
}),
500: Type.Object({
message: Type.Literal('Something went wrong.'),
type: Type.Literal('danger')
})
}
};
35 changes: 35 additions & 0 deletions client/config/growthbook-features-default.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"aa-test": {
"defaultValue": false
},
"aa-test-in-component": {
"defaultValue": false
},
"landing-page-redesign": {
"defaultValue": false,
"rules": [
{
"coverage": 1,
"hashAttribute": "id",
"seed": "landing-page-redesign",
"hashVersion": 2,
"variations": [false, true],
"weights": [0.5, 0.5],
"key": "landing-page-redesign",
"meta": [
{
"key": "0",
"name": "Control"
},
{
"key": "1",
"name": "Variation 1"
}
],
"phase": "0",
"name": "tests the conversion rate of the new design comparing to the old one"
}
]
}
}

Loading

0 comments on commit 5d2598e

Please sign in to comment.