File tree Expand file tree Collapse file tree 3 files changed +21
-20
lines changed
Expand file tree Collapse file tree 3 files changed +21
-20
lines changed Original file line number Diff line number Diff line change 1- import {
2- Type ,
3- type FastifyPluginCallbackTypebox
4- } from '@fastify/type-provider-typebox' ;
1+ import { type FastifyPluginCallbackTypebox } from '@fastify/type-provider-typebox' ;
52import Stripe from 'stripe' ;
63import {
74 donationSubscriptionConfig ,
@@ -62,22 +59,7 @@ export const donateRoutes: FastifyPluginCallbackTypebox = (
6259 fastify . post (
6360 '/donate/add-donation' ,
6461 {
65- schema : {
66- body : Type . Object ( { } ) ,
67- response : {
68- 200 : Type . Object ( {
69- isDonating : Type . Boolean ( )
70- } ) ,
71- 400 : Type . Object ( {
72- message : Type . Literal ( 'User is already donating.' ) ,
73- type : Type . Literal ( 'info' )
74- } ) ,
75- 500 : Type . Object ( {
76- message : Type . Literal ( 'Something went wrong.' ) ,
77- type : Type . Literal ( 'danger' )
78- } )
79- }
80- }
62+ schema : schemas . addDonation
8163 } ,
8264 async ( req , reply ) => {
8365 try {
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ export { msTrophyChallengeCompleted } from './schemas/challenge/ms-trophy-challe
1111export { projectCompleted } from './schemas/challenge/project-completed' ;
1212export { saveChallenge } from './schemas/challenge/save-challenge' ;
1313export { deprecatedEndpoints } from './schemas/deprecated' ;
14+ export { addDonation } from './schemas/donate/add-donation' ;
1415export { chargeStripeCard } from './schemas/donate/charge-stripe-card' ;
1516export { chargeStripe } from './schemas/donate/charge-stripe' ;
1617export { createStripePaymentIntent } from './schemas/donate/create-stripe-payment-intent' ;
Original file line number Diff line number Diff line change 1+ import { Type } from '@fastify/type-provider-typebox' ;
2+
3+ export const addDonation = {
4+ body : Type . Object ( { } ) ,
5+ response : {
6+ 200 : Type . Object ( {
7+ isDonating : Type . Boolean ( )
8+ } ) ,
9+ 400 : Type . Object ( {
10+ message : Type . Literal ( 'User is already donating.' ) ,
11+ type : Type . Literal ( 'info' )
12+ } ) ,
13+ 500 : Type . Object ( {
14+ message : Type . Literal ( 'Something went wrong.' ) ,
15+ type : Type . Literal ( 'danger' )
16+ } )
17+ }
18+ } ;
You can’t perform that action at this time.
0 commit comments