File tree Expand file tree Collapse file tree 4 files changed +12
-5
lines changed Expand file tree Collapse file tree 4 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -9,12 +9,13 @@ export default async function routes(fastify: FastifyInstance) {
9
9
fastify . post ( '/sync' , {
10
10
preHandler : [ verifyApiKey ] ,
11
11
handler : async ( request , reply ) => {
12
- const { created, object } =
12
+ const { created, object, backfillRelatedEntities } =
13
13
( request . body as {
14
14
created ?: Stripe . RangeQueryParam
15
15
object ?: string
16
+ backfillRelatedEntities ?: boolean
16
17
} ) ?? { }
17
- const params = { created, object } as SyncBackfillParams
18
+ const params = { created, object, backfillRelatedEntities } as SyncBackfillParams
18
19
const result = await syncBackfill ( params )
19
20
return reply . send ( {
20
21
statusCode : 200 ,
Original file line number Diff line number Diff line change @@ -7,12 +7,14 @@ export default async function routes(fastify: FastifyInstance) {
7
7
fastify . post ( '/daily' , {
8
8
preHandler : [ verifyApiKey ] ,
9
9
handler : async ( request , reply ) => {
10
- const { object } = ( request . body as { object ?: string } ) ?? { }
10
+ const { object, backfillRelatedEntities } =
11
+ ( request . body as { object ?: string ; backfillRelatedEntities ?: boolean } ) ?? { }
11
12
const currentTimeInSeconds = Math . floor ( Date . now ( ) / 1000 )
12
13
const dayAgoTimeInSeconds = currentTimeInSeconds - 60 * 60 * 24
13
14
const params = {
14
15
created : { gte : dayAgoTimeInSeconds } ,
15
16
object : object ?? 'all' ,
17
+ backfillRelatedEntities,
16
18
} as SyncBackfillParams
17
19
18
20
await syncBackfill ( params )
Original file line number Diff line number Diff line change @@ -7,12 +7,14 @@ export default async function routes(fastify: FastifyInstance) {
7
7
fastify . post ( '/monthly' , {
8
8
preHandler : [ verifyApiKey ] ,
9
9
handler : async ( request , reply ) => {
10
- const { object } = ( request . body as { object ?: string } ) ?? { }
10
+ const { object, backfillRelatedEntities } =
11
+ ( request . body as { object ?: string ; backfillRelatedEntities ?: boolean } ) ?? { }
11
12
const currentTimeInSeconds = Math . floor ( Date . now ( ) / 1000 )
12
13
const monthAgoTimeInSeconds = currentTimeInSeconds - 60 * 60 * 24 * 30
13
14
const params = {
14
15
created : { gte : monthAgoTimeInSeconds } ,
15
16
object : object ?? 'all' ,
17
+ backfillRelatedEntities,
16
18
} as SyncBackfillParams
17
19
18
20
const result = await syncBackfill ( params )
Original file line number Diff line number Diff line change @@ -7,12 +7,14 @@ export default async function routes(fastify: FastifyInstance) {
7
7
fastify . post ( '/weekly' , {
8
8
preHandler : [ verifyApiKey ] ,
9
9
handler : async ( request , reply ) => {
10
- const { object } = ( request . body as { object ?: string } ) ?? { }
10
+ const { object, backfillRelatedEntities } =
11
+ ( request . body as { object ?: string ; backfillRelatedEntities ?: boolean } ) ?? { }
11
12
const currentTimeInSeconds = Math . floor ( Date . now ( ) / 1000 )
12
13
const weekAgoTimeInSeconds = currentTimeInSeconds - 60 * 60 * 24 * 7
13
14
const params = {
14
15
created : { gte : weekAgoTimeInSeconds } ,
15
16
object : object ?? 'all' ,
17
+ backfillRelatedEntities,
16
18
} as SyncBackfillParams
17
19
18
20
const result = await syncBackfill ( params )
You can’t perform that action at this time.
0 commit comments