Skip to content

Commit

Permalink
Merge pull request #218 from NUTFes/feature/takasuka/217-teacher-name…
Browse files Browse the repository at this point in the history
…-bug

レコード作成時にteacherが木実太郎になるバグを修正する
  • Loading branch information
imaimai17468 authored Jul 8, 2023
2 parents dd548ae + fb8a5f5 commit bfe62a9
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ interface CurriculumChapters {
}

interface Teacher {
user_id: number | string;
record_id: string;
user_id: string;
}

interface User {
Expand All @@ -72,7 +71,7 @@ const RecordAddModal: FC<ModalProps> = (props) => {
const [curriculumChapter, setCurriculumChapter] = useState<CurriculumChapters>();
const [records, setRecords] = useState<Record[]>([]);
const [users, setUsers] = useState<User[]>([{ id: '', name: '' }]);
const [teacherData, setTeacherData] = useState<Teacher>({ user_id: 1, record_id: '' });
const [teacherData, setTeacherData] = useState<Teacher>({ user_id: '1' });
const [isAnimationOpen, setIsAnimationOpen] = useState(false);
const [newRecordId, setNewRecordId] = useState('');

Expand Down Expand Up @@ -128,8 +127,8 @@ const RecordAddModal: FC<ModalProps> = (props) => {
) => {
setRecordData({ ...recordData, [input]: e.target.value });
};

const handleTeacher = () => (e: React.ChangeEvent<HTMLSelectElement>) => {
const handleTeacher = (e: React.ChangeEvent<HTMLSelectElement>) => {
setTeacherData({ ...teacherData, user_id: e.target.value });
};

Expand Down

0 comments on commit bfe62a9

Please sign in to comment.