Update Course Form
@@ -222,7 +280,7 @@ const CourseUpdatePage = ({ }) => {
placeholder='e.g. hartloff@buffalo.edu' invalidated={!!invalidFields.get("studentEmail")} helpText={invalidFields.get("studentEmail")} />
{/* csv should be a good standard filetype */}
-
+
From dbac57142902ab1f4bca996307803a776c59820f Mon Sep 17 00:00:00 2001
From: NeemZ16 <110858265+NeemZ16@users.noreply.github.com>
Date: Sat, 26 Oct 2024 01:37:58 -0400
Subject: [PATCH 11/12] adding and dropping multiple users tested, works.
adding and dropping single users tested, works.
---
.../src/components/pages/forms/courses/courseUpdatePage.tsx | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/devU-client/src/components/pages/forms/courses/courseUpdatePage.tsx b/devU-client/src/components/pages/forms/courses/courseUpdatePage.tsx
index 5c1caee..71e5f12 100644
--- a/devU-client/src/components/pages/forms/courses/courseUpdatePage.tsx
+++ b/devU-client/src/components/pages/forms/courses/courseUpdatePage.tsx
@@ -113,7 +113,6 @@ const CourseUpdatePage = ({ }) => {
const handleFileChange = (event: React.ChangeEvent) => {
const uploadedFile = event.target.files?.[0] || null;
if (uploadedFile) {
- console.log("file uploaded")
handleFileUpload(uploadedFile);
}
};
@@ -166,7 +165,6 @@ const CourseUpdatePage = ({ }) => {
const user: User | undefined = res.find((user: User) => user.email === email);
if (user) {
- console.log("User found");
return user.id;
} else {
console.log("User not found");
@@ -181,7 +179,7 @@ const CourseUpdatePage = ({ }) => {
const addSingleStudent = async (email: string) => {
const id = await getUserId(email)
- if (!id) {
+ if (id == 0) {
setAlert({ autoDelete: false, type: 'error', message: "userID not found" })
return
}
From 7f5a738a8b23e8566ac9ab35e63af7673521ed22 Mon Sep 17 00:00:00 2001
From: NeemZ16 <110858265+NeemZ16@users.noreply.github.com>
Date: Sat, 26 Oct 2024 02:12:17 -0400
Subject: [PATCH 12/12] fixed date input subtracting a day
---
.../components/pages/forms/courses/courseUpdatePage.tsx | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/devU-client/src/components/pages/forms/courses/courseUpdatePage.tsx b/devU-client/src/components/pages/forms/courses/courseUpdatePage.tsx
index 71e5f12..e76454c 100644
--- a/devU-client/src/components/pages/forms/courses/courseUpdatePage.tsx
+++ b/devU-client/src/components/pages/forms/courses/courseUpdatePage.tsx
@@ -45,8 +45,8 @@ const CourseUpdatePage = ({ }) => {
number: '',
semester: '',
})
- const [startDate, setStartDate] = useState(new Date().toISOString().split("T")[0])
- const [endDate, setEndDate] = useState(new Date().toISOString().split("T")[0])
+ const [startDate, setStartDate] = useState(new Date().toISOString())
+ const [endDate, setEndDate] = useState(new Date().toISOString())
const [studentEmail, setStudentEmail] = useState("")
const [emails, setEmails] = useState([])
const [invalidFields, setInvalidFields] = useState(new Map())
@@ -89,8 +89,8 @@ const CourseUpdatePage = ({ }) => {
name: formData.name,
number: formData.number,
semester: formData.semester,
- startDate: startDate,
- endDate: endDate,
+ startDate: startDate + "T16:02:41.849Z",
+ endDate: endDate + "T16:02:41.849Z",
}
RequestService.put(`/api/courses/${courseId}`, finalFormData)