Skip to content

Commit 978ab53

Browse files
committed
Added SCEvents ability to create event
1 parent 15ebf1d commit 978ab53

2 files changed

Lines changed: 1 addition & 28 deletions

File tree

src/APIFunctions/SCEvents.js

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -83,29 +83,3 @@ export async function createSCEvent(eventBody) {
8383
}
8484
return status;
8585
}
86-
87-
export async function getEventByID(id) {
88-
let status = new ApiResponse();
89-
90-
try {
91-
const url = new URL(`/events/${id}`, SCEVENTS_API_URL);
92-
const res = await fetch(url.href, {
93-
method: 'GET',
94-
headers: {
95-
'Content-Type': 'application/json',
96-
},
97-
});
98-
99-
if (res.ok) {
100-
const result = await res.json();
101-
status.responseData = result;
102-
} else {
103-
status.error = true;
104-
}
105-
} catch (err) {
106-
status.error = true;
107-
status.responseData = err;
108-
}
109-
110-
return status;
111-
}

src/Pages/Events/CreateEventPage.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Link, useHistory } from 'react-router-dom';
44
import { useSCE } from '../../Components/context/SceContext.js';
55
import { createSCEvent, getSCEventsBaseUrl } from '../../APIFunctions/SCEvents.js';
66
import CreateEventFormQuestionBlock from './CreateEventFormQuestionBlock.js';
7-
const enums = require('../../Enums.js');
7+
import { membershipState } from '../../Enums';
88

99
/** Matches SCEvents `max_attendees` when there is no cap. */
1010
const UNLIMITED_ATTENDEES = -1;
@@ -70,7 +70,6 @@ function toApiRegistrationForm(questions) {
7070
export default function CreateEventPage() {
7171
const { user } = useSCE();
7272
const history = useHistory();
73-
const { membershipState } = enums;
7473

7574
const [eventId] = useState(() => crypto.randomUUID());
7675
const [eventName, setEventName] = useState('');

0 commit comments

Comments
 (0)