Skip to content

Commit

Permalink
refactor: use Pick for preview
Browse files Browse the repository at this point in the history
  • Loading branch information
mplewis committed Oct 24, 2024
1 parent 4f88f50 commit 0941e30
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions api/src/services/events/preview.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { PutObjectCommand, S3Client } from '@aws-sdk/client-s3'
import { Event } from 'types/graphql'

import { S3_REGION, S3_BUCKET, CI } from 'src/app.config'

Expand All @@ -10,14 +11,12 @@ import { renderEventPreview } from './ogImage'
* Generate and upload a public preview image for the given event.
* @param event The event for which to update the public preview image
*/
export async function updateEventPreviewImage(event: {
start: string | Date
end: string | Date
title: string
description: string
slug: string
timezone?: string
}) {
export async function updateEventPreviewImage(
event: Pick<
Event,
'start' | 'end' | 'title' | 'description' | 'slug' | 'timezone'
>
) {
if (CI) return

const screenshot = await renderEventPreview(event)
Expand Down

0 comments on commit 0941e30

Please sign in to comment.