add media page + backend + minor changes to media related stuff & sidebar
This commit is contained in:
1 parent
c46309e458
commit
eba9721a3c
20 files changed
+597
-73
No files matched your search
@@ -0,0 +1,24 @@
|
||||
const express = require('express');
|
||||
const EntrySeen = require('../models/EntrySeen');
|
||||
const Entry = require('../models/Entry');
|
||||
const Media = require('../models/Media');
|
||||
|
||||
const customMediaRouter = express.Router();
|
||||
|
||||
// ! /custom-media
|
||||
// * GET - ALL CUSTOM MEDIA
|
||||
customMediaRouter.get('/', async (req, res) => {
|
||||
|
||||
const allCustomMedia = await Media.findAll({
|
||||
where: {
|
||||
isCustom: true
|
||||
},
|
||||
include: [
|
||||
{ model: Entry, as: 'entry' }
|
||||
]
|
||||
})
|
||||
|
||||
res.status(200).json(allCustomMedia);
|
||||
});
|
||||
|
||||
module.exports = customMediaRouter;
|
||||
Reference in new issue
Block a user