Bug fix and verb standardization
This commit is contained in:
@@ -10,7 +10,7 @@ const getBookmarks = async (_req, res) => {
|
||||
conn.end();
|
||||
};
|
||||
|
||||
const postBookmark = async (req, res) => {
|
||||
const createBookmark = async (req, res) => {
|
||||
const conn = await pool.getConnection();
|
||||
const query = `INSERT INTO trigger_database.bookmarks (name, url, category, \`index\`, enabled) VALUES (${escapeString(req.body.name)}, ${escapeString(req.body.url)}, ${escapeString(req.body.category)}, ${req.body.index}, ${req.body.enabled});`;
|
||||
conn
|
||||
@@ -24,7 +24,7 @@ const postBookmark = async (req, res) => {
|
||||
conn.end();
|
||||
};
|
||||
|
||||
const patchBookmark = async (req, res) => {
|
||||
const updateBookmark = async (req, res) => {
|
||||
const conn = await pool.getConnection();
|
||||
const query = `UPDATE trigger_database.bookmarks SET name = ${escapeString(req.body.name)}, url = ${escapeString(req.body.url)}, category = ${escapeString(req.body.category)}, \`index\` = ${req.body.index}, enabled = ${req.body.enabled} WHERE id = ${req.body.id}`;
|
||||
conn
|
||||
@@ -65,7 +65,7 @@ const deleteBookmark = async (req, res) => {
|
||||
conn.end();
|
||||
};
|
||||
|
||||
const patchBookmarkOrder = async (req, res) => {
|
||||
const updateBookmarkOrder = async (req, res) => {
|
||||
const conn = await pool.getConnection();
|
||||
req.body.map(async (link) => {
|
||||
return conn
|
||||
@@ -90,7 +90,7 @@ const getBookmarkCategories = async (_req, res) => {
|
||||
conn.end();
|
||||
};
|
||||
|
||||
const postBookmarkCategory = async (req, res) => {
|
||||
const createBookmarkCategory = async (req, res) => {
|
||||
const conn = await pool.getConnection();
|
||||
const query = `INSERT INTO trigger_database.bookmarkCategories (categoryName, categoryIndex, filterName) VALUES (${escapeString(req.body.categoryName)},${req.body.categoryIndex || 0},${escapeString(req.body.filterName)})`;
|
||||
conn.query(query).then((_rows) => {
|
||||
@@ -99,7 +99,7 @@ const postBookmarkCategory = async (req, res) => {
|
||||
conn.end();
|
||||
};
|
||||
|
||||
const patchBookmarkCategory = async (req, res) => {
|
||||
const updateBookmarkCategory = async (req, res) => {
|
||||
const conn = await pool.getConnection();
|
||||
const query = `UPDATE trigger_database.bookmarkCategories SET categoryName = ${escapeString(req.body.categoryName)}, filterName = ${escapeString(req.body.filterName)}, enabled = ${req.body.enabled} WHERE id = ${req.body.id};`;
|
||||
conn
|
||||
@@ -127,7 +127,7 @@ const deleteBookmarkCategory = async (req, res) => {
|
||||
conn.end();
|
||||
};
|
||||
|
||||
const patchBookmarkCategoryOrder = async (req, res) => {
|
||||
const updateBookmarkCategoryOrder = async (req, res) => {
|
||||
const conn = await pool.getConnection();
|
||||
req.body.map(async (category) => {
|
||||
return conn
|
||||
@@ -145,13 +145,13 @@ const patchBookmarkCategoryOrder = async (req, res) => {
|
||||
|
||||
module.exports = {
|
||||
getBookmarks,
|
||||
postBookmark,
|
||||
patchBookmark,
|
||||
createBookmark,
|
||||
updateBookmark,
|
||||
deleteBookmark,
|
||||
patchBookmarkOrder,
|
||||
updateBookmarkOrder,
|
||||
getBookmarkCategories,
|
||||
postBookmarkCategory,
|
||||
patchBookmarkCategory,
|
||||
createBookmarkCategory,
|
||||
updateBookmarkCategory,
|
||||
deleteBookmarkCategory,
|
||||
patchBookmarkCategoryOrder,
|
||||
updateBookmarkCategoryOrder,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user