public async Task DeletePage(string pageId)
        {
            await EnsureProjectSettings().ConfigureAwait(false);

            await _eventHandlers.HandlePreDelete(_settings.Id, pageId).ConfigureAwait(false);

            // we have a loosely coupled raltionship of pages not enforced in the db
            // so we have to consider how to handle child pages belonging to a page that is about to be deleted
            // it seems dangerous to cascade the delete to child pages
            // in most cases a delete decisioon should be made on each page
            // the possibility of accidently deleting multiple pages would be high
            // so for now we will just orphan the children to become root pages
            // which can result in a bad user experience if a bunch of pages suddenly appear in the root
            // we will show a warning that indicates the child pages will become root pages
            // and that they should delete child pages before deleting the parent page if that is the intent
            await HandleChildPagesBeforeDelete(pageId);

            await _pageCommands.Delete(_settings.Id, pageId).ConfigureAwait(false);
        }
Example #2
0
        public async Task DeletePage(string projectId, string pageId)
        {
            await eventHandlers.HandlePreDelete(projectId, pageId).ConfigureAwait(false);

            await pageCommands.Delete(projectId, pageId).ConfigureAwait(false);
        }