diff --git a/src/components/CourseList.vue b/src/components/CourseList.vue new file mode 100644 index 0000000..1deb380 --- /dev/null +++ b/src/components/CourseList.vue @@ -0,0 +1,111 @@ + + + + + \ No newline at end of file diff --git a/src/components/CreateEditCourseModel.vue b/src/components/CreateEditCourseModel.vue new file mode 100644 index 0000000..58ca510 --- /dev/null +++ b/src/components/CreateEditCourseModel.vue @@ -0,0 +1,123 @@ + + + + + \ No newline at end of file diff --git a/src/router/courseManagement.js b/src/router/courseManagement.js index 6ac476e..4c8fdce 100644 --- a/src/router/courseManagement.js +++ b/src/router/courseManagement.js @@ -1,9 +1,9 @@ -// import CourseList from '../views/course-management/CourseList.vue' -// import CourseDetail from '../views/course-management/CourseDetail.vue' -// import CourseEdit from '../views/course-management/CourseEdit.vue' +import CourseManagement from '../views/course-management/CourseManagement.vue'; export default [ - // { path: '/courses', component: CourseList }, - // { path: '/courses/:id', component: CourseDetail }, - // { path: '/courses/:id/edit', component: CourseEdit } -] + { + path: '/courses', + name: 'Courses', + component: CourseManagement + } +]; \ No newline at end of file diff --git a/src/services/courseService.js b/src/services/courseService.js index e69de29..fac5816 100644 --- a/src/services/courseService.js +++ b/src/services/courseService.js @@ -0,0 +1,27 @@ +import axios from 'axios'; + +const API_URL = '/api'; + +class CourseService { + createCourse(course) { + return axios.post(`${API_URL}/course/create`, course, { + headers: { + 'Content-Type': 'multipart/form-data' + } + }); + } + + editCourse(courseId, course) { + return axios.put(`${API_URL}/course/edit/${courseId}`, course, { + headers: { + 'Content-Type': 'multipart/form-data' + } + }); + } + + getCourse(courseId) { + return axios.get(`${API_URL}/course/get/${courseId}`); + } +} + +export default new CourseService(); \ No newline at end of file diff --git a/src/views/authentication/Login.vue b/src/views/authentication/Login.vue index 3868819..6d3c14c 100644 --- a/src/views/authentication/Login.vue +++ b/src/views/authentication/Login.vue @@ -25,6 +25,10 @@ const login = async () => { console.error("Login error:", error); } }; + +const goToRegister = () => { + router.push('/register'); +};