Edit Logic Finished
This commit is contained in:
@@ -22,7 +22,6 @@ export default function InputForm(p) {
|
|||||||
const [endDate, setEndDate] = useState(endDateParam);
|
const [endDate, setEndDate] = useState(endDateParam);
|
||||||
const [courseName, setCourseName] = useState(courseNameParam);
|
const [courseName, setCourseName] = useState(courseNameParam);
|
||||||
const [users, setUsers] = useState([]);
|
const [users, setUsers] = useState([]);
|
||||||
const [moduleInfos, setModuleInfos] = useState([])
|
|
||||||
const [checkedSelected, setCheckedSelected] = useState(new Array(100).fill(false))
|
const [checkedSelected, setCheckedSelected] = useState(new Array(100).fill(false))
|
||||||
const [activatedSelected, setActivatedSelected] = useState(new Array(100).fill(false))
|
const [activatedSelected, setActivatedSelected] = useState(new Array(100).fill(false))
|
||||||
const [modulesNames, setModulesNames] = useState(new Array(100).fill("Please Select"))
|
const [modulesNames, setModulesNames] = useState(new Array(100).fill("Please Select"))
|
||||||
@@ -82,7 +81,6 @@ export default function InputForm(p) {
|
|||||||
|
|
||||||
setModulesNames(temp);
|
setModulesNames(temp);
|
||||||
|
|
||||||
setModuleInfos(m);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
for(let i = 0; i < user.length; i++)
|
for(let i = 0; i < user.length; i++)
|
||||||
@@ -165,6 +163,15 @@ export default function InputForm(p) {
|
|||||||
body: JSON.stringify(json1)
|
body: JSON.stringify(json1)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
let deleteURL = "http://localhost:8080/module?sessionid=" + localStorage.getItem("sessionid") +
|
||||||
|
"&semesterid=" + semesterid +
|
||||||
|
"&userid=" + value.getUserid();
|
||||||
|
await fetch(deleteURL, {
|
||||||
|
method: "DELETE"
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
router.back();
|
router.back();
|
||||||
|
|||||||
Binary file not shown.
@@ -270808,3 +270808,180 @@ No data is available [2000-214]
|
|||||||
2023-05-25 13:21:24 jdbc[3]: exception
|
2023-05-25 13:21:24 jdbc[3]: exception
|
||||||
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
No data is available [2000-214]
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:25:24 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:25:24 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:25:25 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:25:25 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:25:25 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:25:32 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:25:32 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:25:33 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:25:33 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:25:33 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:25:34 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:25:34 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:25:54 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:25:54 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:25:55 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:25:55 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:25:55 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:25:55 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:25:55 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:25:55 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:25:55 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:25:55 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:25:59 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:25:59 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:26:01 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:26:01 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:26:01 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:26:01 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:26:01 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:26:01 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:26:01 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:26:01 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:26:01 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:26:13 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:26:13 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:26:14 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:35:14 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:35:14 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:35:15 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:35:15 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:35:15 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:35:21 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:35:21 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:35:22 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:35:22 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:35:22 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:35:22 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:35:22 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:35:38 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:35:38 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:35:39 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:35:39 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:35:39 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:35:39 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:35:39 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:35:39 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:35:39 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:35:45 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
2023-05-25 13:35:45 jdbc[3]: exception
|
||||||
|
org.h2.jdbc.JdbcSQLNonTransientException: Keine Daten verfügbar
|
||||||
|
No data is available [2000-214]
|
||||||
|
|||||||
@@ -459,10 +459,10 @@ public class DataBaseHandler
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean deleteModule(int id)
|
public boolean deleteModule(int semesterid, int userid)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
st.executeUpdate("DELETE FROM modules WHERE id=" + id);
|
st.executeUpdate("delete from modules where semesterid=" + semesterid + " and userid=" + userid);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
catch(Exception ex) {
|
catch(Exception ex) {
|
||||||
|
|||||||
@@ -153,12 +153,12 @@ public class ModuleController
|
|||||||
|
|
||||||
@CrossOrigin
|
@CrossOrigin
|
||||||
@DeleteMapping("/module")
|
@DeleteMapping("/module")
|
||||||
public void deleteModule(@RequestParam(name = "sessionid") String sessionid, @RequestParam(name = "id") int id)
|
public void deleteModule(@RequestParam(name = "sessionid") String sessionid, @RequestParam(name = "semesterid") int semesterid, @RequestParam(name = "userid") int userid)
|
||||||
{
|
{
|
||||||
User u = UserSessionIDHandler.getUserBySessionID(sessionid);
|
User u = UserSessionIDHandler.getUserBySessionID(sessionid);
|
||||||
if (u != null && u.getPermissions() == UserPermissions.admin.getValue())
|
if (u != null && u.getPermissions() == UserPermissions.admin.getValue())
|
||||||
{
|
{
|
||||||
db.deleteModule(id);
|
db.deleteModule(semesterid, userid);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user