File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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- }
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { Link, useHistory } from 'react-router-dom';
44import { useSCE } from '../../Components/context/SceContext.js' ;
55import { createSCEvent , getSCEventsBaseUrl } from '../../APIFunctions/SCEvents.js' ;
66import 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. */
1010const UNLIMITED_ATTENDEES = - 1 ;
@@ -70,7 +70,6 @@ function toApiRegistrationForm(questions) {
7070export 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 ( '' ) ;
You can’t perform that action at this time.
0 commit comments