Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
7a3e69e
Update package and yarn lock files
sanjeev29 Nov 10, 2025
dfe9627
Add createEvent API helper function
sanjeev29 Nov 10, 2025
7fba47e
Add a create event modal for `+ Create New` button
sanjeev29 Nov 10, 2025
04e7086
Add CreateEvent Modal to the community portal reports participation page
sanjeev29 Nov 10, 2025
97a6e85
Merge branch 'development' of https://github.com/OneCommunityGlobal/H…
sanjeev29 Dec 2, 2025
dd7ee3f
Update yarn.lock
sanjeev29 Dec 2, 2025
748175a
Fix dark mode UI for participation page
sanjeev29 Jan 7, 2026
ceea9f5
update yarn.lock
sanjeev29 Jan 7, 2026
8c59b6d
restore development yarn.lock and package-json.lock
sanjeev29 Jan 7, 2026
67a74f0
Merge branch 'development' into Sanjeev-fix-create-new-event-button
sanjeev29 Jan 7, 2026
6350588
update yarn.lock and package-json.lock
sanjeev29 Jan 7, 2026
5a99976
Merge branch 'development' of https://github.com/OneCommunityGlobal/H…
sanjeev29 Jan 26, 2026
c11f8ff
Fix broken import
sanjeev29 Jan 26, 2026
44149a7
Fix dark mode for card view
sanjeev29 Jan 26, 2026
313c262
Merge branch 'Sanjeev-fix-create-new-event-button' of https://github.…
sanjeev29 Jan 26, 2026
ead84c4
Fix dark mode for event date, start, and end time
sanjeev29 Jan 31, 2026
5f61636
Fix dark mode text in upcoming event cards
sanjeev29 Jan 31, 2026
52adf07
Merge branch 'development' of https://github.com/OneCommunityGlobal/H…
sanjeev29 Jan 31, 2026
15f6e67
Merge branch 'development' of https://github.com/OneCommunityGlobal/H…
sanjeev29 Feb 1, 2026
87e705b
Merge branch 'development' into Sanjeev-fix-create-new-event-button
sanjeev29 Feb 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions src/actions/communityPortal/eventActions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import axios from 'axios';
import { ENDPOINTS } from '../../utils/URL';
import { toast } from 'react-toastify';

export const createEvent = eventData => {
return async dispatch => {
try {
const res = await axios.post(ENDPOINTS.EVENTS, eventData);
if (res.status === 201) {
toast.success('Event created successfully!');
return { success: true, event: res.data };
}
return { success: false, error: 'Unexpected response status' };
} catch (error) {
if (error.response?.status === 500) {
toast.error('Error creating event. Please try again.');
} else if (error.response?.status === 404 || error.response?.status === 403 || error.response?.status === 400) {
toast.error('Permission or Validation Error. Please check your input or access rights');
} else {
toast.error('Error creating event. Please try again.');
}
return { success: false, error: error.response?.data || error.message };
}
};
};

Loading
Loading