Skip to content

Commit

Permalink
schedule teacherid added
Browse files Browse the repository at this point in the history
  • Loading branch information
RchtDshr committed Sep 29, 2024
1 parent 195aeed commit 1780b7c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Schedule/Schedule.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ const SchedulePaper = () => {

const handleSubmit = async (e) => {
e.preventDefault();
const minutes = duration.minutes === '' ? 0 : duration.minutes;
const minutes = duration.minutes.trim() === '' ? '00' : duration.minutes;
const teacherId = localStorage.getItem('teacherId');
// console.log(teacherId);
if (!marksError) {
const paperData = {
paperName,
Expand All @@ -133,8 +135,8 @@ const SchedulePaper = () => {
},
date: formatDateForDB(date),
time: formatTimeForDB(time),
teacherId,
};

try {
await axios.post('http://localhost:5000/paper/schedule', paperData, {
headers: {
Expand All @@ -148,7 +150,7 @@ const SchedulePaper = () => {
setClassName('');
setSubject('');
setMarks('');
setDuration('');
setDuration({ hours: '', minutes: '' });
setDate(null);
setTime(null);
} catch (error) {
Expand Down

0 comments on commit 1780b7c

Please sign in to comment.