Skip to content
This repository has been archived by the owner on Oct 26, 2024. It is now read-only.

Commit

Permalink
feat(sponsor): add sponsors in formated file (#179)
Browse files Browse the repository at this point in the history
  • Loading branch information
MaloPolese authored Nov 22, 2023
1 parent a926c3b commit d0c26f8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
11 changes: 7 additions & 4 deletions scripts/openplanner/getSpeakersSessionsSchedule.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable */
import fsA from 'fs'
import {Session, Speaker, Event, Track, TeamMember} from './types'
import {Session, Speaker, Event, Track, TeamMember, Sponsor} from './types'

const fs = fsA.promises

Expand Down Expand Up @@ -45,8 +45,9 @@ export const getSpeakersSessionsSchedule = async (payload: {
speakers: Speaker[],
sessions: Session[],
team: TeamMember[]
sponsors: Sponsor[]
}): Promise<{}> => {
const {event, speakers, sessions, team} = payload
const {event, speakers, sessions, team, sponsors} = payload

const tracks: Track[] = event.tracks.map((t: Track, index: number) => ({
...t,
Expand Down Expand Up @@ -269,7 +270,7 @@ export const getSpeakersSessionsSchedule = async (payload: {
delete schedule["1"]

// 5. Add team members
console.log('Adding team, ' + team.length + ' members')
console.log('Find team, ' + team.length + ' members')
const teamMembers = team.map((member: TeamMember) => {
return {
id: member.id,
Expand All @@ -279,14 +280,16 @@ export const getSpeakersSessionsSchedule = async (payload: {
socials: mapPersonSocials(member)
}
})
console.log('Find sponsors, ' + sponsors.length + ' sponsors')

console.log("Formatting output data done!")

const fileContent = {
speakers: outputSpeakers,
sessions: outputSessions,
schedule: schedule,
team: teamMembers
team: teamMembers,
sponsors
}

await fs.writeFile(outputFile, JSON.stringify(fileContent, null, 4))
Expand Down
11 changes: 11 additions & 0 deletions scripts/openplanner/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,14 @@ export interface TeamMember {
photoUrl: string | null
socials?: SpeakerSocial[]
}

export interface Sponsor {
id: string
name: string
sponsors: [{
id: string,
logoUrl: string,
name: string,
website: string,
}]
}

0 comments on commit d0c26f8

Please sign in to comment.