Presentation Action Endpoints
* changes on presentation serializer
added presentation.actions collection
Mark action as completed by current user
PUT /api/v1/summits/{id}/selection-plans/{selection_plan_id}/presentations/{presentation_id}/actions/{action_id}
required scopes
%s/summits/write
authz_groups
SuperAdmins,
Administrators,
TrackChairs,
TrackChairsAdmins,
Mark action as uncompleted by current user
DELETE /api/v1/summits/{id}/selection-plans/{selection_plan_id}/presentations/{presentation_id}/actions/{action_id}
required scopes
%s/summits/write
authz_groups
SuperAdmins,
Administrators,
TrackChairs,
TrackChairsAdmins,
Change-Id: I09a0443190a7ea713d76f9b79906fa6554fe2eff
Signed-off-by: smarcet <smarcet@gmail.com>
This commit is contained in:
@@ -54,7 +54,8 @@ class PresentationSerializer extends SummitEventSerializer
|
||||
'speakers',
|
||||
'links',
|
||||
'extra_questions',
|
||||
'public_comments'
|
||||
'public_comments',
|
||||
'actions',
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -133,6 +134,15 @@ class PresentationSerializer extends SummitEventSerializer
|
||||
$values['extra_questions'] = $answers;
|
||||
}
|
||||
|
||||
if(in_array('actions', $relations))
|
||||
{
|
||||
$actions = [];
|
||||
foreach ($presentation->getPresentationActions() as $action) {
|
||||
$actions[] = $action->getId();
|
||||
}
|
||||
$values['actions'] = $actions;
|
||||
}
|
||||
|
||||
if (!empty($expand)) {
|
||||
foreach (explode(',', $expand) as $relation) {
|
||||
$relation = trim($relation);
|
||||
@@ -228,6 +238,14 @@ class PresentationSerializer extends SummitEventSerializer
|
||||
$values['extra_questions'] = $answers;
|
||||
}
|
||||
break;
|
||||
case 'actions':{
|
||||
$actions = [];
|
||||
foreach ($presentation->getPresentationActions() as $action) {
|
||||
$actions[]= SerializerRegistry::getInstance()->getSerializer($action)->serialize(AbstractSerializer::filterExpandByPrefix($expand, $relation));
|
||||
}
|
||||
$values['actions'] = $actions;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user