-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] Ability to add books via QR or Barcode #38
Comments
I would recommend installing react-barcode-reader and using that library. |
It appears we need to add: react-barcode Libraries from npm for this function to work |
Note: react-barcode-reader and react-qr-reader were added today. |
hii @gbowne1
Can you explain once again ..I am not clearly getting you |
@LOGESH-B Perhaps I will re write the issue so it is easier. I added the react-barcode-reader npm package. I think this is partly necessary in order for users to use a barcode scanner to scan the barcode on most programming books in order to put them in the database easily. |
Hii @gbowne1 I scanned books with Online Aspose barcode reader |
We would have to connect to an external data source (or another external API) in order for it to query the ISBN for more details. This is not something that needs to be implemented right away, but enough is working that it is indeed possible. Barcodes on books are usually in the EAN format and yes, usually it is only the ISBN number. I just saying for someone like me with over 300+ books on programming and coding it might be a bit difficult to enter in all the data for each book. Before we can do all this we need the models, schemas, etc. for the books themselves so we don't have to rely on the json. |
this reminds me.. const mongoose = require('mongoose');
const bookSchema = new mongoose.Schema({
title: { type: String, required: true },
author: { type: String, required: true },
description: { type: String },
rating: { type: Number },
reviews: [{ type: mongoose.Schema.Types.ObjectId, ref: 'Review' }],
});
const Book = mongoose.model('Book', bookSchema);
module.exports = Book; or... const express = require('express');
const router = express.Router();
const Book = require('../models/book');
router.get('/books', async (req, res) => {
try {
const books = await Book.find();
res.json(books);
} catch (err) {
console.error(err);
res.status(500).json({ message: 'Server Error' });
}
});
router.post('/books', async (req, res) => {
const { title, author, description, rating } = req.body;
try {
const book = new Book({ title, author, description, rating });
await book.save();
res.json(book);
} catch (err) {
console.error(err);
res.status(500).json({ message: 'Server Error' });
}
});
module.exports = router; |
@gbowne1 Assign to me i will work on that🙌 |
I mean I can totally make that a new [TODO] issue to make the models for books like above. @LOGESH-B give me a few moments. |
@gbowne1 Ok |
ok new issue added. Comment so I can assign. |
@BlackBond06 This is the issue for adding books via barcode |
Some users may have already a lot of coding/programming books and to save time entering data may choose to use a reader, their phone or another device to save their books to the database instead of typing in the information.
The text was updated successfully, but these errors were encountered: