diff --git a/src/api/protectedApiClient.ts b/src/api/protectedApiClient.ts index bbb0d9c4..e69739b5 100644 --- a/src/api/protectedApiClient.ts +++ b/src/api/protectedApiClient.ts @@ -52,6 +52,7 @@ export interface ProtectedApiClient { eventId: number, request: UpdateTicketsRequest, ) => Promise; + readonly getProtectedEvents: () => Promise; readonly getMyEvents: () => Promise; readonly getRequestStatuses: () => Promise; readonly makePFRequest: () => Promise; @@ -130,6 +131,12 @@ const updateTickets = (eventId: number, request: UpdateTicketsRequest) => { }); }; +const getProtectedEvents = (): Promise => { + return AppAxiosInstance.get(`${ProtectedApiClientRoutes.EVENTS}`).then( + (res) => res.data.events, + ); +}; + const getMyEvents = (): Promise => { return AppAxiosInstance.get( `${ProtectedApiClientRoutes.EVENTS}/signed_up`, @@ -301,6 +308,7 @@ const Client: ProtectedApiClient = Object.freeze({ getAllUsersContactInfo, createAnnouncement, deleteAnnouncement, + getProtectedEvents, }); export default Client; diff --git a/src/components/EventsForm.tsx b/src/components/EventsForm.tsx index 386bef5e..3aedd4c1 100644 --- a/src/components/EventsForm.tsx +++ b/src/components/EventsForm.tsx @@ -51,12 +51,14 @@ export interface EventsForm { export interface EventsFormData extends EventsForm { thumbnail?: FileField; + privateDescription?: string; start: Date; end: Date; } export interface EventsFormInitialValues extends EventsForm { thumbnail?: string; + privateDescription?: string; start: Moment; end: Moment; } @@ -177,10 +179,19 @@ const EventsForm: React.FC = ({