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 },
|
||||
network_studio: { type: DataTypes.STRING(40) },
|
||||
collection_id: { type: DataTypes.INTEGER },
|
||||
max_cast: { type: DataTypes.INTEGER, defaultValue: 10 },
|
||||
|
||||
watchlist: { type: DataTypes.BOOLEAN, defaultValue: false },
|
||||
favorit: { type: DataTypes.BOOLEAN, defaultValue: false },
|
||||
hidden: { type: DataTypes.BOOLEAN, defaultValue: false },
|
||||
note: { type: DataTypes.STRING(2000) },
|
||||
|
||||
is_tvseries: { type: DataTypes.BOOLEAN },
|
||||
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 userCollectionRoutes = require('./userCollectionRoutes');
|
||||
const entryIdsRouter = require('./entryIdsRoutes');
|
||||
const entrySeenRouter = require('./entrySeenRoutes');
|
||||
const entryRouter = require('./entryRoutes');
|
||||
const entryRatingsRouter = require('./entryRatingsRoutes');
|
||||
const killerRouter = require('./killerRoutes');
|
||||
const seasonRouter = require('./seasonRoutes');
|
||||
const episodeSeenRouter = require('./episodeSeenRoutes');
|
||||
const userCollectionRoutes = require('./user-collection.routes');
|
||||
const entryIdsRouter = require('./entry-ids.routes');
|
||||
const entrySeenRouter = require('./entry-seen.routes');
|
||||
const entryRouter = require('./entry.routes');
|
||||
const entryRatingsRouter = require('./entry-ratings.routes');
|
||||
const seasonRouter = require('./season.routes');
|
||||
const episodeSeenRouter = require('./episode-seen.routes');
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
@@ -19,8 +18,4 @@ router.use('/entry-ratings', entryRatingsRouter);
|
||||
router.use('/seasons', seasonRouter);
|
||||
router.use('/episode-seen', episodeSeenRouter);
|
||||
|
||||
|
||||
|
||||
router.use('/killer', killerRouter); // ! this route is used to crash the backend
|
||||
|
||||
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 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
|
||||
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
|
||||
app.use('/api/v1', routes);
|
||||
|
||||
|
||||
// ! Error handling middleware
|
||||
const errorHandler = require('./middleware/errorHandler');
|
||||
app.use(errorHandler);
|
||||
|
||||
// ! KILLER ROUTE: used to crash the backend
|
||||
app.use('/killer', killerRouter);
|
||||
|
||||
// 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...`);
|
||||
sequelize
|
||||
// .sync({force: true}) // will drop all tables and recreate them.
|
||||
|
||||
@@ -24,11 +24,12 @@ export interface Entry {
|
||||
certification: number;
|
||||
network_studio: string;
|
||||
collection_id: number;
|
||||
max_cast: number;
|
||||
|
||||
watchlist: boolean;
|
||||
favorit: boolean;
|
||||
hidden: boolean;
|
||||
isInLibrary: boolean;
|
||||
note: string;
|
||||
|
||||
is_tvseries: boolean;
|
||||
status: string;
|
||||
@@ -38,11 +39,13 @@ export interface Entry {
|
||||
|
||||
genres: string[];
|
||||
medias: Media[];
|
||||
|
||||
// temp fields
|
||||
|
||||
poster_path: string;
|
||||
banner_path: string;
|
||||
|
||||
// * front specific fields
|
||||
isInLibrary: boolean;
|
||||
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
}
|
||||
Reference in new issue
Block a user