From 35b0fd00ec5c152ecc5ba937bad34c947da9aae4 Mon Sep 17 00:00:00 2001 From: 5thaks07 <5thaks07@solent.ac.uk> Date: Wed, 13 Dec 2023 11:37:00 +0000 Subject: [PATCH] formatted and cleaned the code --- controllers/index.controller.js | 2 +- controllers/poi.controller.js | 1 - controllers/user.controller.js | 1 - public/album.css | 0 public/{ => icons}/currentlocationicon.png | Bin public/index.js | 2 +- public/utils.js | 4 ++-- 7 files changed, 4 insertions(+), 6 deletions(-) delete mode 100644 public/album.css rename public/{ => icons}/currentlocationicon.png (100%) diff --git a/controllers/index.controller.js b/controllers/index.controller.js index bfc45e4..055a50c 100644 --- a/controllers/index.controller.js +++ b/controllers/index.controller.js @@ -65,4 +65,4 @@ export const userdocs = (req, res) => { return res.render('user-docs', { i18n: res, }); -} +}; diff --git a/controllers/poi.controller.js b/controllers/poi.controller.js index 2950358..67df567 100644 --- a/controllers/poi.controller.js +++ b/controllers/poi.controller.js @@ -16,7 +16,6 @@ import { POI } from '../models/Poi.js'; import mongoose from 'mongoose'; import * as AzureStorage from '../models/AzureStorage.js'; -import e from 'express'; export const getPois = async (req, res) => { try { diff --git a/controllers/user.controller.js b/controllers/user.controller.js index b0d2df6..0b40181 100644 --- a/controllers/user.controller.js +++ b/controllers/user.controller.js @@ -18,7 +18,6 @@ import { POI } from '../models/Poi.js'; import bcrypt from 'bcrypt'; import jwt from 'jsonwebtoken'; import mongoose from 'mongoose'; -import cookieParser from 'cookie-parser'; export const getUserById = async (req, res) => { try { diff --git a/public/album.css b/public/album.css deleted file mode 100644 index e69de29..0000000 diff --git a/public/currentlocationicon.png b/public/icons/currentlocationicon.png similarity index 100% rename from public/currentlocationicon.png rename to public/icons/currentlocationicon.png diff --git a/public/index.js b/public/index.js index 670477c..3afc019 100644 --- a/public/index.js +++ b/public/index.js @@ -21,7 +21,7 @@ let watchId; const geoBtn = document.getElementById('enableGeolocation'); const revokeBtn = document.getElementById('revokeGeolocation'); const customIcon = L.icon({ - iconUrl: 'currentlocationicon.png', + iconUrl: './icons/currentlocationicon.png', iconSize: [32, 32], // Adjust the size as needed iconAnchor: [16, 32], popupAnchor: [0, -32], diff --git a/public/utils.js b/public/utils.js index e2a85bc..de13d25 100644 --- a/public/utils.js +++ b/public/utils.js @@ -18,6 +18,6 @@ async function responseHandler(response, noredirect = false) { alert(data.message); if (response.status !== 200 && response.status !== 201) return false; if (data.token) localStorage.setItem('token', data.token); - if (data.redirect && !noredirect) window.location.replace(data.redirect); + if (data.redirect && !noredirect) window.location.replace(data.redirect); return data; -}; +}