Added PATCH method for categories endpoint
This commit is contained in:
@@ -303,7 +303,14 @@ app.post("/trigger/api/categories", async (req, res) => {
|
||||
conn.end();
|
||||
});
|
||||
|
||||
// TODO: Add patch method
|
||||
app.patch("/trigger/api/categories", async (req, res) => {
|
||||
conn = await pool.getConnection();
|
||||
const query = `UPDATE trigger_database.linkCategories SET categoryName = '${sqlEscape(req.body.categoryName)}', filterName = '${sqlEscape(req.body.filterName)}' WHERE id = '${req.body.id}';`;
|
||||
conn.query(query).then((rows) => {
|
||||
res.status(200);
|
||||
});
|
||||
conn.end();
|
||||
});
|
||||
|
||||
app.delete("/trigger/api/categories", async (req, res) => {
|
||||
conn = await pool.getConnection();
|
||||
|
||||
Reference in New Issue
Block a user