Added backend external API to change the inSafe state in the database
This commit is contained in:
@@ -28,6 +28,17 @@ export const getItemsFromDatabaseV2 = async () => {
|
||||
return { success: false };
|
||||
};
|
||||
|
||||
export const changeInSafeStateV2 = async (itemId, state) => {
|
||||
const [result] = await pool.query(
|
||||
"UPDATE items SET inSafe = ? WHERE id = ?",
|
||||
[state, itemId]
|
||||
);
|
||||
if (result.affectedRows > 0) {
|
||||
return { success: true };
|
||||
}
|
||||
return { success: false };
|
||||
};
|
||||
|
||||
export const getItemsFromDatabase = async (role) => {
|
||||
const sql =
|
||||
role == 0
|
||||
|
Reference in New Issue
Block a user