Skip to content
This repository has been archived by the owner on Dec 16, 2024. It is now read-only.

Commit

Permalink
create event cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
mirmirmirr committed Dec 10, 2024
1 parent bd62f59 commit f13ecb8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
6 changes: 3 additions & 3 deletions src/pages/ConfirmCreated.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ export default function ConfirmCreated() {
const navigate = useNavigate();
const location = useLocation();
const { eventCode, eventName } = location.state || {};
console.log('here');
console.log(eventName);

document.cookie = 'code=' + eventCode;
console.log(document.cookie);

const { isDarkMode, toggleTheme } = useTheme();

const [copySuccess, setCopySuccess] = useState(false);

const handleCopy = () => {
// Please uncomment this when the server does have HTTPS certifications

// navigator.clipboard
// .writeText(eventCode)
// .then(() => {
Expand Down
13 changes: 0 additions & 13 deletions src/pages/CreateEvent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,6 @@ export default function CreateEvent() {

const get_event_data = async () => {
const data = {
// email: '[email protected]',
// password: '123',
title: eventName,
description: eventDescription,
duration: parseInt(selectedInterval),
Expand All @@ -164,7 +162,6 @@ export default function CreateEvent() {

const cookies = document.cookie; // Get all cookies as a single string
const cookieObj = {};
console.log('Ran here 1');

cookies.split(';').forEach((cookie) => {
const [key, value] = cookie.split('=').map((part) => part.trim());
Expand Down Expand Up @@ -212,8 +209,6 @@ export default function CreateEvent() {
}
}

console.log('data sent:', data);

if (selectDaysOfWeek) {
data.event_type = 'generic_week';
data.start_day = selectedStartDay.toLowerCase();
Expand All @@ -222,13 +217,8 @@ export default function CreateEvent() {
data.event_type = 'date_range';
data.start_date = startCalendarDay;
data.end_date = endCalendarDay;
console.log(data.start_date);
console.log(data.end_date);
}

console.log(data);
console.log('works');

try {
const response = await fetch(
'http://tomeeto.cs.rpi.edu:8000/create_event',
Expand All @@ -243,11 +233,8 @@ export default function CreateEvent() {

if (response.ok) {
const responseData = await response.json();
console.log('Response Data:', responseData);
console.log(responseData);

if (responseData.message != 'Event created') {
console.log('ERROR');
handleError(responseData.message);
return;
}
Expand Down

0 comments on commit f13ecb8

Please sign in to comment.