refactor(vikon): remove hardcoded module IDs and use config everywhere

This commit is contained in:
F4ilji
2026-07-05 11:40:02 +05:00
parent 8cf195efb0
commit 0a5f99e6ae
6 changed files with 12 additions and 14 deletions
@@ -42,12 +42,8 @@ class SyncFilesAction
private function getModuleName(int $moduleId): string
{
return match ($moduleId) {
1 => 'sveden',
2 => 'abitur',
6 => 'vsoko',
default => throw new \RuntimeException("Unknown module: {$moduleId}"),
};
$modules = config('vikon.modules');
return $modules[$moduleId]['path'] ?? throw new \RuntimeException("Unknown module: {$moduleId}");
}
private function getUsedDirNames(int $moduleId, string $accessToken): array