Final clean up
This commit is contained in:
parent
905ab263de
commit
3ba36e7430
@ -28,9 +28,9 @@ export default {
|
||||
|
||||
const uri = "https://id.twitch.tv/oauth2/token?client_id=" + userFound.twitch_client_id + "&client_secret=" + userFound.twitch_client_secret + "&grant_type=client_credentials";
|
||||
var response = await fetch(uri, { method: 'POST' });
|
||||
var mData = await response.json();
|
||||
const mData = await response.json();
|
||||
|
||||
var mheaders = {
|
||||
const mheaders = {
|
||||
'Accept': 'application/json',
|
||||
'Client-ID': userFound.twitch_client_id,
|
||||
'Authorization': 'Bearer ' + mData.access_token
|
||||
@ -51,9 +51,9 @@ export default {
|
||||
return res.status(404).json({ message: 'wrong code' });
|
||||
}
|
||||
|
||||
var date = new Date(gameData[0].first_release_date * 1000);
|
||||
const date = new Date(gameData[0].first_release_date * 1000);
|
||||
const options: Intl.DateTimeFormatOptions = { day: 'numeric', month: 'short', year: 'numeric' }
|
||||
var dateStr = date.toLocaleDateString(undefined, options);
|
||||
const dateStr = date.toLocaleDateString(undefined, options);
|
||||
|
||||
|
||||
response = await fetch(
|
||||
@ -83,7 +83,7 @@ export default {
|
||||
},
|
||||
|
||||
remove: async function (req: Request, res: Response) {
|
||||
var id = req.body.code;
|
||||
const id = req.body.code;
|
||||
|
||||
try {
|
||||
const movie = await GameModel.findOneAndDelete({ code: id });
|
||||
|
@ -65,7 +65,7 @@ export default {
|
||||
* mediaController.delete()
|
||||
*/
|
||||
remove: async function (req: Request, res: Response) {
|
||||
var id = req.body.code;
|
||||
const id = req.body.code;
|
||||
|
||||
try {
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { type Express, type NextFunction, type Request, type Response } from "express";
|
||||
import { type NextFunction, type Request, type Response } from "express";
|
||||
import UserModel from '../models/userModel';
|
||||
|
||||
|
||||
|
@ -1,12 +1,11 @@
|
||||
import express, { type Request, type Response } from "express";
|
||||
const router = express.Router();
|
||||
|
||||
import checkAuthenticated from '../../miscellaneous/checkAuthenticated';
|
||||
|
||||
import mediaRouter from './mediaRouter';
|
||||
import gameRouter from './gameRouter';
|
||||
import cashTransactionRouter from './cashTransactionRouter';
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
router.use('/games', gameRouter);
|
||||
router.use('/movies', mediaRouter);
|
||||
router.use('/series', mediaRouter);
|
||||
|
@ -1,7 +1,8 @@
|
||||
import express from "express";
|
||||
const router = express.Router();
|
||||
import cashTransaction from '../../controllers/cashTransactionController';
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
router.post('/list', cashTransaction.list);
|
||||
|
||||
router.post('/', cashTransaction.create);
|
||||
|
@ -1,8 +1,9 @@
|
||||
import express from "express";
|
||||
var router = express.Router();
|
||||
import gameController from '../../controllers/gameController';
|
||||
import checkAuthenticated from '../../miscellaneous/checkAuthenticated';
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
router.get('/', gameController.list);
|
||||
|
||||
router.post('/', checkAuthenticated, gameController.create);
|
||||
|
@ -2,7 +2,7 @@ import express from "express";
|
||||
import mediaController from '../../controllers/mediaController.js';
|
||||
import checkAuthenticated from '../../miscellaneous/checkAuthenticated';
|
||||
|
||||
var router = express.Router();
|
||||
const router = express.Router();
|
||||
|
||||
router.get('/', mediaController.list);
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
import express, { type Request, type Response } from "express";
|
||||
const router = express.Router();
|
||||
|
||||
import userData from './userKnowledge.json';
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
/* GET home page. */
|
||||
router.get('/', function (req: Request, res: Response) {
|
||||
const project = userData.project;
|
||||
|
@ -1,9 +1,9 @@
|
||||
import express, { type Request, type Response } from "express";
|
||||
var router = express.Router();
|
||||
import userController from '../controllers/userController';
|
||||
|
||||
import checkAuthenticated from '../miscellaneous/checkAuthenticated';
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
/* GET home page. */
|
||||
router.get('/', function (req: Request, res: Response) {
|
||||
res.render('user', { title: 'Register' });
|
||||
|
Loading…
x
Reference in New Issue
Block a user