Ejemplo n.º 1
0
 public static Task <HttpTimeline> PatchTimelineAsync(this HttpClient client, string timelineName, HttpTimelinePatchRequest body)
 => client.TestPatchAsync <HttpTimeline>($"timelines/{timelineName}", body);
Ejemplo n.º 2
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);
        }