mirror of
https://github.com/pawelmalak/flame.git
synced 2025-07-28 23:29:37 +02:00
Bookmark import.
This commit is contained in:
parent
1fff824957
commit
1aedb87bf4
17 changed files with 327 additions and 8 deletions
22
controllers/bookmarks/importBookmark.js
Normal file
22
controllers/bookmarks/importBookmark.js
Normal file
|
@ -0,0 +1,22 @@
|
|||
const asyncWrapper = require('../../middleware/asyncWrapper');
|
||||
const ErrorResponse = require('../../utils/ErrorResponse');
|
||||
const importBookmarkData = require('../../utils/importBookmark');
|
||||
const Bookmark = require('../../models/Bookmark');
|
||||
|
||||
// @desc Import bookmarks from file.
|
||||
// @route POST /api/bookmarks/import
|
||||
// @access Public
|
||||
const importBookmark = asyncWrapper(async (req, res, next) => {
|
||||
importBookmarkData(req.file.path);
|
||||
|
||||
if(next){
|
||||
next();
|
||||
} else {
|
||||
res.status(200).json({
|
||||
success: true,
|
||||
data: bookmark,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = importBookmark;
|
Loading…
Add table
Add a link
Reference in a new issue