renamed backend routes files + add fields to entry model
This commit is contained in:
1 parent
21aaead02a
commit
d6c3a974a1
13 files changed
+24
-18
No files matched your search
@@ -18,10 +18,12 @@ const Entry = sequelize.define("entry",
|
|||||||
certification: { type: DataTypes.INTEGER },
|
certification: { type: DataTypes.INTEGER },
|
||||||
network_studio: { type: DataTypes.STRING(40) },
|
network_studio: { type: DataTypes.STRING(40) },
|
||||||
collection_id: { type: DataTypes.INTEGER },
|
collection_id: { type: DataTypes.INTEGER },
|
||||||
|
max_cast: { type: DataTypes.INTEGER, defaultValue: 10 },
|
||||||
|
|
||||||
watchlist: { type: DataTypes.BOOLEAN, defaultValue: false },
|
watchlist: { type: DataTypes.BOOLEAN, defaultValue: false },
|
||||||
favorit: { type: DataTypes.BOOLEAN, defaultValue: false },
|
favorit: { type: DataTypes.BOOLEAN, defaultValue: false },
|
||||||
hidden: { type: DataTypes.BOOLEAN, defaultValue: false },
|
hidden: { type: DataTypes.BOOLEAN, defaultValue: false },
|
||||||
|
note: { type: DataTypes.STRING(2000) },
|
||||||
|
|
||||||
is_tvseries: { type: DataTypes.BOOLEAN },
|
is_tvseries: { type: DataTypes.BOOLEAN },
|
||||||
status: { type: DataTypes.STRING(20) },
|
status: { type: DataTypes.STRING(20) },
|
||||||
|
|||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,12 +1,11 @@
|
|||||||
const express = require('express');
|
const express = require('express');
|
||||||
const userCollectionRoutes = require('./userCollectionRoutes');
|
const userCollectionRoutes = require('./user-collection.routes');
|
||||||
const entryIdsRouter = require('./entryIdsRoutes');
|
const entryIdsRouter = require('./entry-ids.routes');
|
||||||
const entrySeenRouter = require('./entrySeenRoutes');
|
const entrySeenRouter = require('./entry-seen.routes');
|
||||||
const entryRouter = require('./entryRoutes');
|
const entryRouter = require('./entry.routes');
|
||||||
const entryRatingsRouter = require('./entryRatingsRoutes');
|
const entryRatingsRouter = require('./entry-ratings.routes');
|
||||||
const killerRouter = require('./killerRoutes');
|
const seasonRouter = require('./season.routes');
|
||||||
const seasonRouter = require('./seasonRoutes');
|
const episodeSeenRouter = require('./episode-seen.routes');
|
||||||
const episodeSeenRouter = require('./episodeSeenRoutes');
|
|
||||||
|
|
||||||
const router = express.Router();
|
const router = express.Router();
|
||||||
|
|
||||||
@@ -19,8 +18,4 @@ router.use('/entry-ratings', entryRatingsRouter);
|
|||||||
router.use('/seasons', seasonRouter);
|
router.use('/seasons', seasonRouter);
|
||||||
router.use('/episode-seen', episodeSeenRouter);
|
router.use('/episode-seen', episodeSeenRouter);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
router.use('/killer', killerRouter); // ! this route is used to crash the backend
|
|
||||||
|
|
||||||
module.exports = router;
|
module.exports = router;
|
||||||
File renamed without changes.
File renamed without changes.
+9
-3
@@ -7,6 +7,10 @@ const path = require('path');
|
|||||||
|
|
||||||
const app = express();
|
const app = express();
|
||||||
const PORT = process.env.PORT || 4000;
|
const PORT = process.env.PORT || 4000;
|
||||||
|
const relations = require('./db/relations.js');
|
||||||
|
const sequelizeHooks = require('./db/sequelizeHooks.js');
|
||||||
|
const { initializeGenres, initializeData } = require('./db/dataInitializer.js');
|
||||||
|
const killerRouter = require('./routes/killer.routes.js');
|
||||||
|
|
||||||
// Middleware
|
// Middleware
|
||||||
app.use(bodyParser.json()); // for parsing application/json
|
app.use(bodyParser.json()); // for parsing application/json
|
||||||
@@ -50,14 +54,16 @@ app.use('/api/v1/media/:category/:type', (req, res, next) => {
|
|||||||
// * other api routes
|
// * other api routes
|
||||||
app.use('/api/v1', routes);
|
app.use('/api/v1', routes);
|
||||||
|
|
||||||
|
|
||||||
// ! Error handling middleware
|
// ! Error handling middleware
|
||||||
const errorHandler = require('./middleware/errorHandler');
|
const errorHandler = require('./middleware/errorHandler');
|
||||||
app.use(errorHandler);
|
app.use(errorHandler);
|
||||||
|
|
||||||
|
// ! KILLER ROUTE: used to crash the backend
|
||||||
|
app.use('/killer', killerRouter);
|
||||||
|
|
||||||
// Start the server
|
// Start the server
|
||||||
const relations = require('./db/relations.js');
|
|
||||||
const sequelizeHooks = require('./db/sequelizeHooks.js');
|
|
||||||
const { initializeGenres, initializeData } = require('./db/dataInitializer.js');
|
|
||||||
console.log(`Syncing database schema...`);
|
console.log(`Syncing database schema...`);
|
||||||
sequelize
|
sequelize
|
||||||
// .sync({force: true}) // will drop all tables and recreate them.
|
// .sync({force: true}) // will drop all tables and recreate them.
|
||||||
|
|||||||
@@ -24,11 +24,12 @@ export interface Entry {
|
|||||||
certification: number;
|
certification: number;
|
||||||
network_studio: string;
|
network_studio: string;
|
||||||
collection_id: number;
|
collection_id: number;
|
||||||
|
max_cast: number;
|
||||||
|
|
||||||
watchlist: boolean;
|
watchlist: boolean;
|
||||||
favorit: boolean;
|
favorit: boolean;
|
||||||
hidden: boolean;
|
hidden: boolean;
|
||||||
isInLibrary: boolean;
|
note: string;
|
||||||
|
|
||||||
is_tvseries: boolean;
|
is_tvseries: boolean;
|
||||||
status: string;
|
status: string;
|
||||||
@@ -38,11 +39,13 @@ export interface Entry {
|
|||||||
|
|
||||||
genres: string[];
|
genres: string[];
|
||||||
medias: Media[];
|
medias: Media[];
|
||||||
|
|
||||||
// temp fields
|
|
||||||
poster_path: string;
|
poster_path: string;
|
||||||
banner_path: string;
|
banner_path: string;
|
||||||
|
|
||||||
|
// * front specific fields
|
||||||
|
isInLibrary: boolean;
|
||||||
|
|
||||||
createdAt: Date;
|
createdAt: Date;
|
||||||
updatedAt: Date;
|
updatedAt: Date;
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user