-
Notifications
You must be signed in to change notification settings - Fork 1
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
Vytvor endpoint pre hodnotenia predmetov #283
base: master
Are you sure you want to change the base?
Conversation
Vytvor API endpoint, ktory vracia pre kazdy predmet za kazdy semester jeho hodnotenie. Closes fmfi-svt#256
Tento endpoint by mal vracat to co query v #256, mam ale este dve otazky:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@j-matus Vdaka za PR!
Doplnil som iba take malickosti.
Co sa tyka toho bodu 2, tak tam je pre databazu nastaveny specialny user.
Pokazene prava su asi iba na tvojej databaze. Ked pouzijem inu aa_<nieco>
, tak viem selectovat z toho Viewu.
public function ratingsAction() { | ||
$request = $this->get('request'); | ||
$user = $this->get('anketa.access.statistics')->getUser(); | ||
if ($request->getMethod() != 'POST' && $user === null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tu dajme iba GET
. POST nema zmysel, kedze neposielame ziadne data.
@@ -142,4 +142,21 @@ public function getMostRecentAverageEvaluations($subjectCodes) { | |||
$query->execute($subjectCodes); | |||
return $query->fetchAll(\PDO::FETCH_ASSOC); | |||
} | |||
|
|||
public function getSubjectsRatings() { | |||
$sql = 'SELECT code,name,slug,season_id,score '. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Iba nitpick - pridaj +2 medzery.
@@ -2,3 +2,7 @@ api_results: | |||
pattern: /api/v1/results/ | |||
defaults: { _controller: AnketaBundle:Api:results, _format: json } | |||
options: { i18n: false } | |||
api_ratings: | |||
pattern: /api/v1/ratings/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tu by sme mohli vymazat to /api
, kedze ten link je aktualne /api/api/...
@j-matus Vies to prosim este otestovat nejako, ci to vracia dobre vysledky? |
@j-matus Ahoj, mas nejake novinky ohladom tohto? |
Vytvor API endpoint, ktory vracia pre kazdy predmet za kazdy semester
jeho hodnotenie. Closes #256
This change is