Example #1
0
        public async Task <ActionResult <HttpTimeline> > TimelinePatch([FromRoute][GeneralTimelineName] string timeline, [FromBody] HttpTimelinePatchRequest body)
        {
            var timelineId = await _service.GetTimelineIdByNameAsync(timeline);

            if (!UserHasAllTimelineManagementPermission && !await _service.HasManagePermissionAsync(timelineId, GetUserId()))
            {
                return(ForbidWithCommonResponse());
            }

            await _service.ChangePropertyAsync(timelineId, _mapper.AutoMapperMap <TimelineChangePropertyParams>(body));

            var t = await _service.GetTimelineAsync(timelineId);

            var result = await Map(t);

            return(result);
        }