src/fursvp.api/Controllers/EventController.cs
/// <summary>
/// Updates an Event so that it is no longer publicly visible.
/// </summary>
/// <param name="eventId">The globally unique identifier for the Event.</param>
/// <returns>200 Ok on success, or 404 Not Found if the Event Id is not found.</returns>
Updates an Event so that it is no longer publicly visible.
Updates an Event so that it is no longer publicly visible .
[HttpDelete]
        [Route("{eventId}/publish")]
        public async Task<IActionResult> UnpublishEvent(Guid eventId)
        {
            var @event = await EventRepositoryRead.GetById(eventId).ConfigureAwait(false);
            if (@event == null)
            {
                return NotFound("Event not found with id " + eventId);
            }
            @event.IsPublished = true;
            await EventRepositoryWrite.Update(@event).ConfigureAwait(false);
            return Ok(Mapper.MapResponse(@event, DateTimeProvider));
        }
[ HttpDelete ] [ Route ( " " ) ] public async Task < IActionResult > UnpublishEvent ( Guid eventId ) { var @event = await EventRepositoryRead . GetById ( eventId ) . ConfigureAwait ( false ) ; if ( @event == null ) { return NotFound ( " " + eventId ) ; } @event . IsPublished = true ; await EventRepositoryWrite . Update ( @event ) . ConfigureAwait ( false ) ; return Ok ( Mapper . MapResponse ( @event , DateTimeProvider ) ) ; }
Updates an Event so that it is no longer publicly visible.
Updates an Event so that it is no longer publicly visible .
200 Ok on success, or 404 Not Found if the Event Id is not found.
200 Ok on success or 404 Not Found if the Event Id is not found .
eventId
Guid
The globally unique identifier for the Event.
The globally unique identifier for the Event .