Skip to content

Commit

Permalink
Fix build?
Browse files Browse the repository at this point in the history
  • Loading branch information
HugoGresse committed Oct 13, 2024
1 parent 6f32c91 commit 42082da
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Session, Event } from '../../../types'
import { OverwriteSpeakerSessionsType } from './sessionsSpeakers'
import { StaticTypeOfSpeakerSessionsType } from './sessionsSpeakers'

type ElementType<T> = T extends (infer U)[] ? U : never

export const convertBodySessionToSession = (
session: ElementType<OverwriteSpeakerSessionsType['sessions']>,
session: ElementType<StaticTypeOfSpeakerSessionsType['sessions']>,
event: Event
): Session => {
const realSession: Partial<Session> = {
Expand Down
4 changes: 2 additions & 2 deletions functions/src/api/routes/sessionsSpeakers/sessionsSpeakers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export const SpeakersSessionsType = Type.Object({
),
})

export type SpeakerSessionsType = Static<typeof SpeakersSessionsType>
export type StaticTypeOfSpeakerSessionsType = Static<typeof SpeakersSessionsType>

interface IQuerystring {}

Expand All @@ -171,7 +171,7 @@ const ReplyType = Type.Union([
])

export const sessionsSpeakers = (fastify: FastifyInstance, options: any, done: () => any) => {
fastify.post<{ Querystring: IQuerystring; Body: SpeakerSessionsType; Reply: Static<typeof ReplyType> }>(
fastify.post<{ Querystring: IQuerystring; Body: StaticTypeOfSpeakerSessionsType; Reply: Static<typeof ReplyType> }>(
'/v1/:eventId/sessionsSpeakers',
{
schema: {
Expand Down

0 comments on commit 42082da

Please sign in to comment.