diff --git a/backend/app/validators/course.ts b/backend/app/validators/course.ts index 807433c..d9dfcbb 100644 --- a/backend/app/validators/course.ts +++ b/backend/app/validators/course.ts @@ -6,6 +6,6 @@ export const createCourseValidator = vine.compile( .string() .unique(async (db, value) => !(await db.from('courses').where('id', value).first())), name: vine.string(), - registrationId: vine.number(), + registrationId: vine.string(), }) ) diff --git a/backend/database/seeders/1_registration_seeder.ts b/backend/database/seeders/1_registration_seeder.ts index 5299af8..0b15548 100644 --- a/backend/database/seeders/1_registration_seeder.ts +++ b/backend/database/seeders/1_registration_seeder.ts @@ -6,17 +6,17 @@ export default class extends BaseSeeder { await Registration.createMany([ { name: 'W05-EBR-SI-3', - department: 'Wydział Elektryczny [W5]', + departmentId: 'Wydział Elektryczny [W5]', round: 1, }, { name: 'W13-HWDP-SI-3', - department: 'Wydział Matematyki [W13]', + departmentId: 'Wydział Matematyki [W13]', round: 2, }, { name: 'W4-IST-SI-3', - department: 'Wydział Informatyki i Telekomunikacji [W4N]', + departmentId: 'Wydział Informatyki i Telekomunikacji [W4N]', round: 1, }, ]) diff --git a/backend/database/seeders/3_course_seeder.ts b/backend/database/seeders/3_course_seeder.ts index 69f9130..48a04ee 100644 --- a/backend/database/seeders/3_course_seeder.ts +++ b/backend/database/seeders/3_course_seeder.ts @@ -4,8 +4,8 @@ import { BaseSeeder } from '@adonisjs/lucid/seeders' export default class extends BaseSeeder { async run() { await Course.createMany([ - { id: 'usos.mathematics.com', name: 'Mathematics 101', registrationId: 1 }, - { id: 'usos.physics.com', name: 'Physics 2', registrationId: 2 }, + { id: 'usos.mathematics.com', name: 'Mathematics 101', registrationId: '1' }, + { id: 'usos.physics.com', name: 'Physics 2', registrationId: '2' }, ]) } } diff --git a/backend/start/scheduler.ts b/backend/start/scheduler.ts index 44b9171..e863134 100644 --- a/backend/start/scheduler.ts +++ b/backend/start/scheduler.ts @@ -12,6 +12,7 @@ import Registration from '#models/registration' import Course from '#models/course' import Group from '#models/group' +//@ts-ignore const scrapData = async () => { console.log('Scraping departments') const departments = await scrapDepartments()