Skip to content

Commit

Permalink
Merge pull request #201 from SELab-2/package-fixes
Browse files Browse the repository at this point in the history
Fix cypress types
  • Loading branch information
EwoutV authored Mar 29, 2024
2 parents 37d7f3c + 73ffadf commit b1f511e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion frontend/src/components/LanguageSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ onMounted(() => {
</script>

<template>
<Dropdown id="language" v-model="locale" class="w-auto" :options="availableLocales" @change="updateLocale" variant="outlined">
<Dropdown id="language" v-model="locale" class="w-auto" :options="availableLocales" @change="updateLocale($event.value)" variant="outlined">
<template #option="{ option }">
<div class="flex align-items-center">
<img :alt="t('layout.header.language.' + option)" :src="getFlag(option)" class="h-1rem mr-2"/>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/projects/GroupCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const props = defineProps<{
}>();
onMounted(async () => {
await getStudentsByGroup(props.groupId, t);
await getStudentsByGroup(props.groupId);
});
</script>
Expand Down
18 changes: 9 additions & 9 deletions frontend/src/composables/services/admins.service.ts
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
import {Admin} from '@/types/Admin.ts';
import {ref} from 'vue';
import {endpoints} from '@/config/endpoints.ts';
import { get, getList, create, delete_id } from '@/composables/services/helpers.ts';
import {User} from '@/types/User.ts';

export function useAdmin() {
const admins = ref<Admin[]|null>(null);
const admin = ref<Admin|null>(null);
const admins = ref<User[]|null>(null);
const admin = ref<User|null>(null);

async function getAdminByID(id: string) {
const endpoint = endpoints.admins.retrieve.replace('{id}', id);
await get<Admin>(endpoint, admin, Admin.fromJSON);
await get<User>(endpoint, admin, User.fromJSON);
}

async function getAdmins() {
const endpoint = endpoints.admins.index;
await getList<Admin>(endpoint, admins, Admin.fromJSON);
await getList<User>(endpoint, admins, User.fromJSON);
}

async function createAdmin(admin_data: Admin) {
async function createAdmin(admin_data: User) {
const endpoint = endpoints.admins.index;
await create<Admin>(endpoint,
await create<User>(endpoint,
{
email:admin_data.email,
first_name:admin_data.first_name,
last_name: admin_data.last_name
},
admin, Admin.fromJSON);
admin, User.fromJSON);
}

async function deleteAdmin(id: string) {
const endpoint = endpoints.admins.retrieve.replace('{id}', id);
await delete_id<Admin>(endpoint, admin, Admin.fromJSON);
await delete_id<User>(endpoint, admin, User.fromJSON);
}

return {
Expand Down
1 change: 1 addition & 0 deletions frontend/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"module": "ESNext",
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"skipLibCheck": true,
"types": ["cypress"],

/* Bundler mode */
"moduleResolution": "bundler",
Expand Down

0 comments on commit b1f511e

Please sign in to comment.