cityssm/lottery-licence-manager

View on GitHub
helpers/licencesDB/deleteOrganizationRepresentative.js

Summary

Maintainability
A
0 mins
Test Coverage
F
36%
import sqlite from "better-sqlite3";
import { licencesDB as databasePath } from "../../data/databasePaths.js";
export const deleteOrganizationRepresentative = (organizationID, representativeIndex) => {
    const database = sqlite(databasePath);
    const info = database.prepare("delete from OrganizationRepresentatives" +
        " where organizationID = ?" +
        " and representativeIndex = ?")
        .run(organizationID, representativeIndex);
    database.close();
    return info.changes > 0;
};