-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Study programmes] Use curriculum periods from db instead of hardcodi…
…ng the period format
- Loading branch information
1 parent
3e9fa50
commit 95fbe7d
Showing
6 changed files
with
39 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Request, Response, Router } from 'express' | ||
|
||
import { CurriculumPeriod } from '../models' | ||
|
||
const router = Router() | ||
|
||
router.get('/', async (_req: Request, res: Response) => { | ||
const result = await CurriculumPeriod.findAll() | ||
res.json(result) | ||
}) | ||
|
||
export default router |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { RTKApi } from '@/apiConnection' | ||
|
||
const curriculumPeriodsApi = RTKApi.injectEndpoints({ | ||
endpoints: builder => ({ | ||
getCurriculumPeriods: builder.query({ | ||
query: () => '/curriculum-periods', | ||
}), | ||
}), | ||
overrideExisting: false, | ||
}) | ||
|
||
export const { useGetCurriculumPeriodsQuery } = curriculumPeriodsApi |