update fav
This commit is contained in:
@@ -6,7 +6,7 @@ exports.addToFavorite = async (req, res) => {
|
|||||||
try {
|
try {
|
||||||
// Use parameterized query to prevent SQL injection
|
// Use parameterized query to prevent SQL injection
|
||||||
const [result] = await db.execute(
|
const [result] = await db.execute(
|
||||||
"INSERT INTO Favorites (UserID, ProductID) VALUES (?, ?)",
|
"INSERT INTO Favorites (UserID, ProductID) VALUES unique(?, ?)",
|
||||||
[userID, productsID],
|
[userID, productsID],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user