Podpora za srije modele in controllereje skupaj

This commit is contained in:
Nikola Petrov
2023-08-10 15:05:50 +02:00
parent 9992dda27a
commit 6863081e9e
9 changed files with 66 additions and 69 deletions

View File

@@ -1,11 +0,0 @@
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var gameSchema = new Schema({
'title': String,
'released': String,
'webImg': String,
'code': String
});
module.exports = mongoose.model('game', gameSchema);

15
models/mediaModel.js Normal file
View File

@@ -0,0 +1,15 @@
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var mediaSchema = new Schema({
'title': String,
'released': String,
'webImg': String,
'code': String
});
module.exports = {
MovieModel: mongoose.model('movie', mediaSchema),
SeriesModel: mongoose.model('series', mediaSchema),
GameModel: mongoose.model('game', mediaSchema)
};

View File

@@ -1,11 +0,0 @@
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var movieSchema = new Schema({
'title': String,
'released': String,
'webImg': String,
'code': String
});
module.exports = mongoose.model('movie', movieSchema);