From 73a1f2d3509464f2b1f2696df6569b16d00b1f34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Rom=C3=A3o?= <75808145+andreromao@users.noreply.github.com> Date: Mon, 15 Apr 2024 06:10:56 +0700 Subject: [PATCH] Update v2.4.0 (#231) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add support to Deck2 (#219) * fix: add company description (#220) * feat: add sponsors site (#223) Co-authored-by: André Romão <75808145+andreromao@users.noreply.github.com> * adds calendar to event in cannon (#224) * improves promo codes (#225) * improves compatibility with new deck (#229) * Fix event id type (#230) * improves compatibility with new deck * revert and fix * fix deck url in config * fix eventId * fix --------- Co-authored-by: Nuno Alves Co-authored-by: Pedro Maximino <53193337+PMax5@users.noreply.github.com> --- config.js | 2 +- server/resources/deck.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config.js b/config.js index 857c7a8..545cef1 100644 --- a/config.js +++ b/config.js @@ -13,7 +13,7 @@ config.webapp = { } config.deck = { - url: process.env.CANNON_EVENTDECK_URL || 'https://deck.sinfo.org' + url: process.env.CANNON_EVENTDECK_URL || 'https://deck.sinfo.org/api' } config.upload = { diff --git a/server/resources/deck.js b/server/resources/deck.js index 5423a0e..b2c951c 100644 --- a/server/resources/deck.js +++ b/server/resources/deck.js @@ -16,7 +16,7 @@ server.method('deck.getSession', getSession, {}) server.method('deck.getSpeakers', getSpeakers, {}) server.method('deck.getSpeaker', getSpeaker, {}) -const DECK_API_URL = `${config.deck.url}/api` +const DECK_API_URL = `${config.deck.url}` async function getLatestEdition() { const event = await axios.get(`${DECK_API_URL}/public/events?current=true`, { json: true }) @@ -91,7 +91,7 @@ async function getSpeaker(speakerId) { // Translate Deck's event object to old format function transformEvent(event, options) { return { - id: event.id, + id: String(event.id), name: event.name, kind: options?.kind || "Main Event", public: options?.public || true, @@ -149,7 +149,7 @@ function transformSession(session, options) { name: session.title, description: session.description, kind: sessionKinds[session.kind] || session.kind, - event: options?.event || (session.company?.participation?.length > 0 && session.company.participation[0].event), + event: String(options?.event || (session.company?.participation?.length > 0 && session.company.participation[0].event)), date: session.begin, duration: new Date(new Date(session.end) - new Date(session.begin)), place: session.place,