public/beta.js
// DELETE Sub-Project-Picture functions
DELETE Sub-Project-Picture functions
DELETE Sub - Project - Picture functions
function delete_sub_project_picture_toggle() {
    $('main').on('click', ".sub_project_picture_edit", ( event => {
        event.preventDefault();
        let selected_picture = $(event.currentTarget).parent().attr('id');
        $.getJSON(client_home_url)
            .then(current_account_store => {
                for (let i = 0; i < current_account_store.projects[selected_storage.project].subProjects[selected_storage.subProject].pictures.length; i++) {
                    if (selected_picture == current_account_store.projects[selected_storage.project].subProjects[selected_storage.subProject].pictures[i].pictureDate) {
                        selected_storage.subProjectPictureId = current_account_store.projects[selected_storage.project].subProjects[selected_storage.subProject].pictures[i]._id;
                        console.log(selected_storage.subProjectPictureId);
                    }
                };
            })
            .then(() => {
                console.log(`Deleteing ${selected_storage.selected_sub_project_for_deletion}`);
                client_delete_sub_project_picture_url = change_url(`client_pages/subProjectPicture/${selected_storage.subProjectPictureId}`);
                ajax_delete_sub_project_picture();
            });
    }));
}
function delete_sub_project_picture_toggle ( ) { $ ( 'main' ) . on ( 'click' , ".sub_project_picture_edit" , ( event => { event . preventDefault ( ) ; let selected_picture = $ ( event . currentTarget ) . parent ( ) . attr ( 'id' ) ; $ . getJSON ( client_home_url ) . then ( current_account_store => { for ( let i = 0 ; i < current_account_store . projects [ selected_storage . project ] . subProjects [ selected_storage . subProject ] . pictures . length ; i ++ ) { if ( selected_picture == current_account_store . projects [ selected_storage . project ] . subProjects [ selected_storage . subProject ] . pictures [ i ] . pictureDate ) { selected_storage . subProjectPictureId = current_account_store . projects [ selected_storage . project ] . subProjects [ selected_storage . subProject ] . pictures [ i ] . _id ; console . log ( selected_storage . subProjectPictureId ) ; } } ; } ) . then ( ( ) => { console . log ( ` ${ selected_storage . selected_sub_project_for_deletion } ` ) ; client_delete_sub_project_picture_url = change_url ( ` ${ selected_storage . subProjectPictureId } ` ) ; ajax_delete_sub_project_picture ( ) ; } ) ; } ) ) ; }
DELETE Sub-Project-Picture functions
DELETE Sub - Project - Picture functions