Skip to content

Commit

Permalink
Update course.service.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
tyboro2002 authored Apr 18, 2024
1 parent 2ddb5fa commit 17d3d1f
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions frontend/src/composables/services/course.service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Course } from '@/types/Course.ts';
import { type Ref, ref } from 'vue';
import { endpoints } from '@/config/endpoints.ts';
import { get, getList, create, deleteId, getPaginatedList } from '@/composables/services/helpers.ts';
import { get, getList, create, patch, deleteId, getPaginatedList } from '@/composables/services/helpers.ts';
import { type Response } from '@/types/Response.ts';
import { type CoursePaginatorResponse } from '@/types/filter/Paginator.ts';
import { type Filter } from '@/types/filter/Filter.ts';
Expand Down Expand Up @@ -79,18 +79,18 @@ export function useCourses(): CoursesState {
// Endpoint to update is same as retrieve
const endpoint = endpoints.courses.retrieve.replace('{id}', courseData.id);

await patch(
endpoint,
{
id: courseData.id,
name: courseData.name,
description: courseData.description,
faculty: courseData.faculty?.id,
},
response,
);
await patch(
endpoint,
{
id: courseData.id,
name: courseData.name,
description: courseData.description,
faculty: courseData.faculty?.id,
},
response,
);
}

async function cloneCourse(courseId: string, cloneAssistants: boolean, cloneTeachers: boolean): Promise<void> {
const endpoint = endpoints.courses.clone.replace('{courseId}', courseId);
await create<Course>(
Expand Down

0 comments on commit 17d3d1f

Please sign in to comment.