app/views/account/account.scala.js
//Delete file from server and client-side application
Delete file from server and client-side application
Delete file from server and client - side application
function deleteFile(file) {
            if (CONSOLE_INFO) {
                $log.info('Trying to delete file ' + file.fileName);
            }
            $http.post('/account/api/delete', { action: 'delete', fileName: file.fileName })
                .success(function () {
                    deleteFile_client(file);
                    if (stateInfo.isActiveFile(file) || Object.keys(files).length === 0) {
                        stateInfo.setActiveState(htmlState.ACCOUNT_INFORMATION);
                    } else if (Object.keys(files).length > 0) {
                        chartInfo.update_rarefaction(true);
                        chartInfo.update_summary();
                    }
                    notifications.addSuccessNotification('Deleting', 'Sample ' + file.fileName + ' has been successfully deleted');
                    if (CONSOLE_INFO) {
                        $log.info('File ' + file.fileName + ' successfully deleted');
                    }
                }).error(function(response) {
                    serverLog.log('Error while deleting sample ' + file.fileName);
                    notifications.addErrorNotification('Deleting', 'Error while deleting sample ' + file.fileName);
                    if (CONSOLE_INFO) {
                        $log.error('Error while deleting file ' + file.fileName);
                    }
                });
        }
function deleteFile ( file ) { if ( CONSOLE_INFO ) { $log . info ( 'Trying to delete file ' + file . fileName ) ; } $http . post ( '/account/api/delete' , { action : 'delete' , fileName : file . fileName } ) . success ( function ( ) { deleteFile_client ( file ) ; if ( stateInfo . isActiveFile ( file ) || Object . keys ( files ) . length === 0 ) { stateInfo . setActiveState ( htmlState . ACCOUNT_INFORMATION ) ; } else if ( Object . keys ( files ) . length > 0 ) { chartInfo . update_rarefaction ( true ) ; chartInfo . update_summary ( ) ; } notifications . addSuccessNotification ( 'Deleting' , 'Sample ' + file . fileName + ' has been successfully deleted' ) ; if ( CONSOLE_INFO ) { $log . info ( 'File ' + file . fileName + ' successfully deleted' ) ; } } ) . error ( function ( response ) { serverLog . log ( 'Error while deleting sample ' + file . fileName ) ; notifications . addErrorNotification ( 'Deleting' , 'Error while deleting sample ' + file . fileName ) ; if ( CONSOLE_INFO ) { $log . error ( 'Error while deleting file ' + file . fileName ) ; } } ) ; }
Delete file from server and client-side application
Delete file from server and client - side application