alexiusacademia / electron-db

Electron module that acts as database management and uses flat file database (json file) to store tables.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

delete function error

muhammedkoramaz opened this issue · comments

database design

{
    "files": [{
            "projectName": "Project1",
            "filePath": "/home/koramaz/Belgeler/htdocs/eticaret/css/owl.transitions.css",
            "fileName": "owl.transitions.css",
            "id": 1602791652333
        },
        {
            "projectName": "Project2",
            "filePath": "/home/koramaz/Masaüstü/Proman/images/delete.png",
            "fileName": "delete.png",
            "id": 1602791655161
        }
    ]
}

delete function

function deleteFile(fileName, projectName) {
    var deleteObject = new Object();
    deleteObject.fileName = fileName;
    deleteObject.projectName = projectName;


    console.log(fileName);
    db.deleteRow('files', appPath, deleteObject, (succ, msg) => {
        document.getElementById(fileName).remove();
        console.log(msg);
    });
}

When I send this object to the delete function, the deletion works inconsistently. Values ​​that do not match the parameter I sent are also deleted.

Hello and thank you!

Could you send some data for me to recreate that scenario? Thanks!