Skip to content

Commit

Permalink
chore: undo teachers service
Browse files Browse the repository at this point in the history
  • Loading branch information
EwoutV committed Apr 12, 2024
1 parent 2675ed8 commit 741d616
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions frontend/src/composables/services/teachers.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Teacher[] | null>;
Expand Down Expand Up @@ -58,12 +57,14 @@ export function useTeacher(): TeacherState {
await deleteIdWithData<Response>(endpoint, { teacherId }, response, Response.fromJSON);
}

async function createTeacher(user: User): Promise<void> {
async function createTeacher(teacherData: Teacher): Promise<void> {
const endpoint = endpoints.teachers.index;
await create<Teacher>(
endpoint,
{
user: user.id,
email: teacherData.email,
first_name: teacherData.first_name,
last_name: teacherData.last_name,
},
teacher,
Teacher.fromJSON,
Expand Down

0 comments on commit 741d616

Please sign in to comment.