Added endpoints for Presentation Submission (CFP)
POST /api/v1/summits/{id}/presentations
scopes
* summits/write
* summits/write-event
* summits/write-presentation
payload
* 'title' => 'required|string|max:100'
* 'description' => 'required|string'
* 'social_description' => 'required|string|max:100'
* 'level' => 'required|in:Beginner,Intermediate,Advanced,N/A'
* 'attendees_expected_learnt' => 'required|string|max:1000'
* 'type_id' => 'required|integer'
* 'track_id' => 'required|integer'
* 'attending_media' => 'required|boolean'
* 'links' => 'required|url_array'
* 'extra_questions' => 'sometimes|entity_value_array'
PUT api/v1/summits/{id}/presentations/{presentation_id}
scopes
* summits/write
* summits/write-event
* summits/write-presentation
* 'title' => 'sometimes|string|max:100'
* 'description' => 'sometimes|string'
* 'social_description' => 'sometimes|string|max:100'
* 'level' => 'sometimes|in:Beginner,Intermediate,Advanced,N/A'
* 'attendees_expected_learnt' => 'sometimes|string|max:1000'
* 'type_id' => 'sometimes|integer'
* 'track_id' => 'sometimes|integer'
* 'attending_media' => 'sometimes|boolean'
* 'links' => 'sometimes|url_array'
* 'extra_questions' => 'sometimes|entity_value_array'
Change-Id: Iadc8bf072491a64ef48a1b475b36b92c2fe1d707
This commit is contained in:
@@ -30,7 +30,6 @@ class PresentationSerializer extends SummitEventSerializer
|
||||
];
|
||||
|
||||
protected static $allowed_fields = [
|
||||
|
||||
'track_id',
|
||||
'moderator_speaker_id',
|
||||
'level',
|
||||
@@ -47,6 +46,7 @@ class PresentationSerializer extends SummitEventSerializer
|
||||
'videos',
|
||||
'speakers',
|
||||
'links',
|
||||
'extra_questions',
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -103,6 +103,15 @@ class PresentationSerializer extends SummitEventSerializer
|
||||
$values['videos'] = $videos;
|
||||
}
|
||||
|
||||
if(in_array('extra_questions', $relations))
|
||||
{
|
||||
$answers = [];
|
||||
foreach ($presentation->getAnswers() as $answer) {
|
||||
$answers[]= SerializerRegistry::getInstance()->getSerializer($answer)->serialize();
|
||||
}
|
||||
$values['extra_questions'] = $answers;
|
||||
}
|
||||
|
||||
if (!empty($expand)) {
|
||||
foreach (explode(',', $expand) as $relation) {
|
||||
switch (trim($relation)) {
|
||||
|
||||
Reference in New Issue
Block a user