const query = require('../db/db-query');

module.exports = {
    get: async () => {
        let sql = `SELECT * FROM default_value`;
        try {
            return await query(sql);
        } catch (err) {
            return err;
        }
    },
    post: async (type, value) => {
        let sql = `INSERT INTO default_value(DEFAULT_TYPE,DEFAULT_VALUE) VALUES('${type}','${value}')`;
        try {
            await query(sql);
        } catch (err) {
            return err;
        }
    },
    delete: async (type, value) => {
        let sql = `DELETE FROM default_value WHERE DEFAULT_TYPE='${type}' AND DEFAULT_VALUE='${value}' `;
        try {
            await query(sql);
        } catch (err) {
            return err;
        }
    },
};
