Skip to content

Commit

Permalink
chore: fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
tyboro2002 committed May 21, 2024
1 parent a597d1e commit b4dd653
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 8 deletions.
2 changes: 1 addition & 1 deletion frontend/src/composables/services/admin.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export function useAdmin(): AdminState {
admin,
User.fromJSON,
undefined,
selfprocessError
selfprocessError,
);
}

Expand Down
48 changes: 41 additions & 7 deletions frontend/src/composables/services/assistant.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ interface AssistantState {
assistant: Ref<Assistant | null>;
response: Ref<Response | null>;
assistantPagination: Ref<PaginatorResponse<Assistant> | null>;
getAssistantByID: (id: string, init?:boolean, selfprocessError?: boolean) => Promise<void>;
getAssistantByID: (id: string, init?: boolean, selfprocessError?: boolean) => Promise<void>;
getAssistantsByCourse: (courseId: string, selfprocessError?: boolean) => Promise<void>;
getAssistants: (selfprocessError?: boolean) => Promise<void>;
searchAssistants: (filters: Filter, page: number, pageSize: number, selfprocessError?: boolean) => Promise<void>;
Expand Down Expand Up @@ -44,19 +44,53 @@ export function useAssistant(): AssistantState {
await getList<Assistant>(endpoint, assistants, Assistant.fromJSON, selfprocessError);
}

async function searchAssistants(filters: Filter, page: number, pageSize: number, selfprocessError: boolean = true): Promise<void> {
async function searchAssistants(
filters: Filter,
page: number,
pageSize: number,
selfprocessError: boolean = true
): Promise<void> {
const endpoint = endpoints.assistants.search;
await getPaginatedList<Assistant>(endpoint, filters, page, pageSize, assistantPagination, Assistant.fromJSON, selfprocessError);
await getPaginatedList<Assistant>(
endpoint,
filters,
page,
pageSize,
assistantPagination,
Assistant.fromJSON,
selfprocessError
);
}

async function assistantJoinCourse(courseId: string, assistantId: string, selfprocessError: boolean = true): Promise<void> {
async function assistantJoinCourse(
courseId: string,
assistantId: string,
selfprocessError: boolean = true
): Promise<void> {
const endpoint = endpoints.assistants.byCourse.replace('{courseId}', courseId);
await create<Response>(endpoint, { assistant: assistantId }, response, Response.fromJSON, undefined, selfprocessError);
await create<Response>(
endpoint,
{ assistant: assistantId },
response,
Response.fromJSON,
undefined,
selfprocessError
);
}

async function assistantLeaveCourse(courseId: string, assistantId: string, selfprocessError: boolean = true): Promise<void> {
async function assistantLeaveCourse(
courseId: string,
assistantId: string,
selfprocessError: boolean = true
): Promise<void> {
const endpoint = endpoints.assistants.byCourse.replace('{courseId}', courseId);
await deleteIdWithData<Response>(endpoint, { assistant: assistantId }, response, Response.fromJSON, selfprocessError);
await deleteIdWithData<Response>(
endpoint,
{ assistant: assistantId },
response,
Response.fromJSON,
selfprocessError
);
}

async function createAssistant(user: User, selfprocessError: boolean = true): Promise<void> {
Expand Down

0 comments on commit b4dd653

Please sign in to comment.