// scanner/postWithAuth.js // Versione locale: niente HTTP, niente token, solo DB module.exports = function createPostToDB(db) { /** * Inserisce o aggiorna un record nel DB SQLite * (sostituisce completamente axios.post) */ async function postToDB(record) { if (!record || !record.id) { throw new Error("Record non valido"); } await db('photos') .insert(record) .onConflict('id') .merge(); return true; } return postToDB; };