From 741d61668b81f8b4289e8b9d49525ad468c02428 Mon Sep 17 00:00:00 2001 From: EwoutV Date: Fri, 12 Apr 2024 16:04:05 +0200 Subject: [PATCH] chore: undo teachers service --- frontend/src/composables/services/teachers.service.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/src/composables/services/teachers.service.ts b/frontend/src/composables/services/teachers.service.ts index 33db570b..4c7d7ada 100644 --- a/frontend/src/composables/services/teachers.service.ts +++ b/frontend/src/composables/services/teachers.service.ts @@ -5,7 +5,6 @@ import { type Ref, ref } from 'vue'; import { endpoints } from '@/config/endpoints.ts'; import { get, getList, create, deleteId, deleteIdWithData } from '@/composables/services/helpers.ts'; import { useCourses } from '@/composables/services/courses.service.ts'; -import { type User } from '@/types/users/User.ts'; interface TeacherState { teachers: Ref; @@ -58,12 +57,14 @@ export function useTeacher(): TeacherState { await deleteIdWithData(endpoint, { teacherId }, response, Response.fromJSON); } - async function createTeacher(user: User): Promise { + async function createTeacher(teacherData: Teacher): Promise { const endpoint = endpoints.teachers.index; await create( endpoint, { - user: user.id, + email: teacherData.email, + first_name: teacherData.first_name, + last_name: teacherData.last_name, }, teacher, Teacher.fromJSON,