done purchases remove, ocr scan, read image

This commit is contained in:
LukasNowy
2019-01-28 01:34:06 +01:00
parent d9c3d422d7
commit 93bbf9c2cb
203 changed files with 21267 additions and 41 deletions

View File

@ -378,6 +378,52 @@ router.post("/user", async (req, res) => {
});
//postgres.moveDoneItems('dXMuv1J0f4O7RKn2bizGMTHUYkg1', '2IY2BwLP', 'aAnNNanas bjdbafBROtcHiPs');
router.post("/donepurchases", (req, res) => {
var token = req.query.idtoken;
var uid;
firebaseAdmin.auth().verifyIdToken(token)
.then(async function(decodedToken) {
uid = decodedToken.uid;
try {
res.status(200).send("test");
}
catch(err) {
console.error(error);
}
}).catch( async function(error) {
console.log(error)
});
});
//GET Done Purchases
router.get("/donepurchases", (req, res) => {
var token = req.query.idtoken;
var uid;
firebaseAdmin.auth().verifyIdToken(token)
.then(async function(decodedToken) {
uid = decodedToken.uid;
try {
res.status(200).send(await postgres.getDonePurchases(uid));
}
catch(err) {
res.status(400).send(await err);
}
}).catch( async function(error) {
console.log(error)
});
});
//OCR Scan
router.get("/scan/", async (req, res,) => {
res.render("ocrscan");
});