Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting lessons fails #71

Closed
jotkauser opened this issue Jun 25, 2024 · 0 comments · Fixed by #72
Closed

Getting lessons fails #71

jotkauser opened this issue Jun 25, 2024 · 0 comments · Fixed by #72

Comments

@jotkauser
Copy link
Contributor

Hello, i'm trying to get the lessons list from specific day to today, but it fails
Error: Parametr dateFrom/dateToma nieprawidłową wartość2024-00-We/2024-05-Tu`
at Api.request (D:\Nodev2\vulcanjs\node_modules.pnpm\[email protected]\node_modules\vulcan-api-js\lib\index.cjs:86004:17)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Api.get (D:\Nodev2\vulcanjs\node_modules.pnpm\[email protected]\node_modules\vulcan-api-js\lib\index.cjs:86022:14)
at async ApiHelper.getList (D:\Nodev2\vulcanjs\node_modules.pnpm\[email protected]\node_modules\vulcan-api-js\lib\index.cjs:84159:12)
at async VulcanHebe.getLessons (D:\Nodev2\vulcanjs\node_modules.pnpm\[email protected]\node_modules\vulcan-api-js\lib\index.cjs:86177:18)
at async Object.run (D:\Nodev2\vulcanjs\modules\lessons.js:17:19)

Node.js v18.15.0`

code:

	async run(args) {
		if (!fs.existsSync('./auth/keystore.json') || !fs.existsSync('./auth/account.json')) return console.log('No account or keystore found, please register first');
		const keystore = new Keystore();
		keystore.loadFromJsonString(fs.readFileSync('./auth/keystore.json', { encoding: 'utf-8' }));
		const client = new VulcanHebe(keystore, AccountTools.loadFromJsonString(fs.readFileSync('./auth/account.json', { encoding: 'utf-8' })));
		// student selection
		await client.selectStudent(student());
		// lessons
		const datearg = args[0];
		const date = datearg ? new Date(datearg) : new Date();

		const lessons = await client.getLessons(date, new Date());
		console.log(lessons);
	},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant