Skip to content

Commit

Permalink
Merge pull request #225 from ThatConference/feat/remove-orbit
Browse files Browse the repository at this point in the history
feat: remove all orbit api calls
  • Loading branch information
brettski authored May 30, 2024
2 parents fecc68c + 3e3e58a commit e0324b9
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 58 deletions.
4 changes: 0 additions & 4 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,5 @@ THAT_REQUEST_SIGNING_KEY=''
# graphCdn
GRAPHCDN_TOKEN=

# orbit.love
ORBIT_WS_SLUG=
ORBIT_TOKEN=

# Development switches
#TEST_SLACK_NOTIFICATIONS=
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "that-api-sessions",
"version": "4.7.0",
"version": "4.8.0",
"description": "THAT Conference Sessions Service.",
"main": "index.js",
"engines": {
Expand Down
53 changes: 0 additions & 53 deletions src/events/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import djsTimezone from 'dayjs/plugin/timezone';
import advancedFormat from 'dayjs/plugin/advancedFormat';
import iCal from 'ical-generator';
import * as Sentry from '@sentry/node';
import { orbitLove } from '@thatconference/api';
import envConfig from '../envConfig';
import calendarEvent from '../lib/calendarEvent';
import slackNotifications from '../lib/slackNotifications';
Expand Down Expand Up @@ -340,56 +339,6 @@ function userEvents(postmark) {
}
}

function sendOrbitLoveActivityOnCreate({ session, user, event, firestore }) {
dlog('call sendOrbitLove Activity, on create');
const orbitLoveApi = orbitLove.orbitLoveApi({ firestore });

let getOrbitActivityType = null;
if (session.status === 'ACCEPTED')
getOrbitActivityType = orbitLove.activityTypes.session.createOpenSpace;
else if (session.status === 'SUBMITTED')
getOrbitActivityType = orbitLove.activityTypes.session.submit;
else return undefined;

return (
orbitLoveApi
.addSessionActivity({
activityType: getOrbitActivityType(),
user,
session,
event,
})
// .then(res => dlog('sendOrbitLove result: %o', res))
.catch(err =>
process.nextTick(() => userEventEmitter.emit('error', err)),
)
);
}

function sendOrbitLoveActivtyOnUpdate({ session, user, event, firestore }) {
dlog('call sendOrbitLove Activty, onUpdate');
const orbitLoveApi = orbitLove.orbitLoveApi({ firestore });

let getOrbitActivityType = null;
if (session.status === 'ACCEPTED' && session.type === 'OPENSPACE')
getOrbitActivityType = orbitLove.activityTypes.session.createOpenSpace;
else if (session.status === 'SUBMITTED')
getOrbitActivityType = orbitLove.activityTypes.session.submit;
else return undefined;

return orbitLoveApi
.addSessionActivity({
activityType: getOrbitActivityType(),
user,
session,
event,
})
.then(res => dlog('sendOrbitLove result: %o', res))
.catch(err =>
process.nextTick(() => userEventEmitter.emit('error', err)),
);
}

userEventEmitter.on('emailError', err => {
dlog('emailError %O', err);
Sentry.setTag('section', 'userEventEmitter');
Expand All @@ -412,12 +361,10 @@ function userEvents(postmark) {
userEventEmitter.on('sessionCreated', sendSessionCreatedSlack);
userEventEmitter.on('sessionCreated', setOgImage);
userEventEmitter.on('sessionCreated', createDiscordVoiceChannel);
userEventEmitter.on('sessionCreated', sendOrbitLoveActivityOnCreate);
userEventEmitter.on('sessionUpdated', sendSessionUpdatedEmail);
userEventEmitter.on('sessionUpdated', updateSharedCalendar);
userEventEmitter.on('sessionUpdated', setOgImage);
userEventEmitter.on('sessionUpdated', createDiscordVoiceChannel);
userEventEmitter.on('sessionUpdated', sendOrbitLoveActivtyOnUpdate);
userEventEmitter.on('sessionCancelled', cancelSharedCalendar);

return userEventEmitter;
Expand Down

0 comments on commit e0324b9

Please sign in to comment.