Final clean up

This commit is contained in:
Nikola Petrov
2024-07-16 15:20:26 +02:00
parent 905ab263de
commit 3ba36e7430
9 changed files with 18 additions and 17 deletions

View File

@@ -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 });

View File

@@ -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 {