public async Task <IActionResult> Archive(int id) { var collection = await _eventCollectionRetrievalService .GetCollectionByIdAsync(id, new EventCollectionRetrievalOptions { ForUpdate = true }); await _eventCollectionManagementService.ArchiveCollectionAsync(collection); return(Ok()); }
public async Task <IActionResult> Delete(int id) { try { var collection = await _eventCollectionRetrievalService .GetCollectionByIdAsync(id, new EventCollectionRetrievalOptions { ForUpdate = true }); await _eventCollectionManagementService.ArchiveCollectionAsync(collection); return(Ok()); } catch (NotFoundException e) { return(NotFound(e.Message)); } catch (NotAccessibleException e) { return(NotFound(e.Message)); // FIXME: can't return FORBIDDEN, it will redirect to login page! } }