Selection Plans hotfix
* fixed post/put * added v2 for get summit by id to remove cache Change-Id: I864aa863fe32f1417adc424ef2e03349fc0da0b7
This commit is contained in:
parent
5b649adca1
commit
2116c3f314
@ -532,7 +532,7 @@ Route::group([
|
|||||||
Route::group(['prefix' => 'summits'], function () {
|
Route::group(['prefix' => 'summits'], function () {
|
||||||
|
|
||||||
Route::group(['prefix' => '{id}'], function () {
|
Route::group(['prefix' => '{id}'], function () {
|
||||||
|
Route::get('', [ 'middleware' => 'auth.user:administrators|summit-front-end-administrators', 'uses' => 'OAuth2SummitApiController@getSummit'])->where('id', 'current|[0-9]+');
|
||||||
// events
|
// events
|
||||||
Route::group(['prefix' => 'events'], function () {
|
Route::group(['prefix' => 'events'], function () {
|
||||||
|
|
||||||
|
@ -36,6 +36,8 @@ final class SummitSelectionPlanFactory
|
|||||||
*/
|
*/
|
||||||
public static function populate(SelectionPlan $selection_plan, array $data, Summit $summit){
|
public static function populate(SelectionPlan $selection_plan, array $data, Summit $summit){
|
||||||
|
|
||||||
|
$selection_plan->setSummit($summit);
|
||||||
|
|
||||||
if(isset($data['name']))
|
if(isset($data['name']))
|
||||||
$selection_plan->setName(trim($data['name']));
|
$selection_plan->setName(trim($data['name']));
|
||||||
|
|
||||||
|
@ -81,7 +81,7 @@ final class SummitSelectionPlanService
|
|||||||
|
|
||||||
if(isset($payload['name'])) {
|
if(isset($payload['name'])) {
|
||||||
$former_selection_plan = $summit->getSelectionPlanByName($payload['name']);
|
$former_selection_plan = $summit->getSelectionPlanByName($payload['name']);
|
||||||
if ($former_selection_plan->getId() != $selection_plan_id && !is_null($former_selection_plan)) {
|
if (!is_null($former_selection_plan) && $former_selection_plan->getId() != $selection_plan_id) {
|
||||||
throw new ValidationException(trans(
|
throw new ValidationException(trans(
|
||||||
'validation_errors.SummitSelectionPlanService.updateSelectionPlan.alreadyExistName',
|
'validation_errors.SummitSelectionPlanService.updateSelectionPlan.alreadyExistName',
|
||||||
[
|
[
|
||||||
|
@ -91,7 +91,7 @@ class ApiEndpointsSeeder extends Seeder
|
|||||||
],
|
],
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'name' => 'get-summit',
|
'name' => 'get-summit-cached',
|
||||||
'route' => '/api/v1/summits/{id}',
|
'route' => '/api/v1/summits/{id}',
|
||||||
'http_method' => 'GET',
|
'http_method' => 'GET',
|
||||||
'scopes' => [
|
'scopes' => [
|
||||||
@ -99,6 +99,14 @@ class ApiEndpointsSeeder extends Seeder
|
|||||||
sprintf(SummitScopes::ReadAllSummitData, $current_realm)
|
sprintf(SummitScopes::ReadAllSummitData, $current_realm)
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
[
|
||||||
|
'name' => 'get-summit-non-cached',
|
||||||
|
'route' => '/api/v2/summits/{id}',
|
||||||
|
'http_method' => 'GET',
|
||||||
|
'scopes' => [
|
||||||
|
sprintf(SummitScopes::ReadAllSummitData, $current_realm)
|
||||||
|
],
|
||||||
|
],
|
||||||
[
|
[
|
||||||
'name' => 'add-summit',
|
'name' => 'add-summit',
|
||||||
'route' => '/api/v1/summits',
|
'route' => '/api/v1/summits',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user