diff --git a/controllers/LicensePlate.js b/controllers/LicensePlate.js index 97278f9..a8f4e38 100644 --- a/controllers/LicensePlate.js +++ b/controllers/LicensePlate.js @@ -4,7 +4,7 @@ var utils = require('../utils/writer.js'); var LicensePlate = require('../service/LicensePlateService'); // Function to handle modifying a license plate -module.exports.modifyPlate = function modifyPlate (req, res, next, body) { +module.exports.modifyPlate = function modifyPlate (_,res,__,body) { LicensePlate.modifyPlate(body) .then(function (response) { // Write the response using the utility function @@ -17,7 +17,7 @@ module.exports.modifyPlate = function modifyPlate (req, res, next, body) { }; //Function to handle registering a new license plate -module.exports.registerPlate = function registerPlate (req, res, next, body) { +module.exports.registerPlate = function registerPlate (_,res,__,body) { LicensePlate.registerPlate(body) .then(function (response) { // Write the response using the utility function diff --git a/controllers/Payment.js b/controllers/Payment.js index 8b00867..768ffac 100644 --- a/controllers/Payment.js +++ b/controllers/Payment.js @@ -4,7 +4,7 @@ var utils = require('../utils/writer.js'); var Payment = require('../service/PaymentService'); //Function to handle making a payment -module.exports.makePayment = function makePayment (req, res, next, body) { +module.exports.makePayment = function makePayment (_ ,res,__, body) { Payment.makePayment(body) .then(function (response) { // Write the response using the utility function @@ -14,4 +14,4 @@ module.exports.makePayment = function makePayment (req, res, next, body) { // Write the error response using the utility function utils.writeJson(res, response); }); -}; +}; \ No newline at end of file diff --git a/controllers/Reservation.js b/controllers/Reservation.js index b3a6658..6158bbc 100644 --- a/controllers/Reservation.js +++ b/controllers/Reservation.js @@ -4,7 +4,7 @@ var utils = require('../utils/writer.js'); var Reservation = require('../service/ReservationService'); // Function to handle deleting a reservation -module.exports.deleteReservation = function deleteReservation (req, res, next, id) { +module.exports.deleteReservation = function deleteReservation (_, res, __, id) { Reservation.deleteReservation(id) .then(function (response) { // Write the response using the utility function @@ -17,7 +17,7 @@ module.exports.deleteReservation = function deleteReservation (req, res, next, i }; //Function to handle making a reservation -module.exports.makeReservation = function makeReservation (req, res, next, body) { +module.exports.makeReservation = function makeReservation (_, res,__, body) { Reservation.makeReservation(body) .then(function (response) { // Write the response using the utility function @@ -30,7 +30,7 @@ module.exports.makeReservation = function makeReservation (req, res, next, body) }; //Function to handle modifying a reservation -module.exports.modifyReservation = function modifyReservation (req, res, next, body, spotId, userId, startTime, duration, date, id) { +module.exports.modifyReservation = function modifyReservation (_, res, __, body, spotId, userId, startTime, duration, date, id) { Reservation.modifyReservation(body, spotId, userId, startTime, duration, date, id) .then(function (response) { // Write the response using the utility function @@ -40,4 +40,4 @@ module.exports.modifyReservation = function modifyReservation (req, res, next, b // Write the error response using the utility function utils.writeJson(res, response); }); -}; +}; \ No newline at end of file diff --git a/controllers/Spot.js b/controllers/Spot.js index cd7adb7..9db71a9 100644 --- a/controllers/Spot.js +++ b/controllers/Spot.js @@ -4,7 +4,7 @@ var utils = require('../utils/writer.js'); var Spot = require('../service/SpotService'); //Function to handle creating a new spot -module.exports.createSpot = function createSpot (req, res, next, body) { +module.exports.createSpot = function createSpot (_, res, __, body) { Spot.createSpot(body) .then(function (response) { // Write the response using the utility function @@ -17,7 +17,7 @@ module.exports.createSpot = function createSpot (req, res, next, body) { }; //Function to handle retrieving all spots -module.exports.getSpots = function getSpots (req, res, next) { +module.exports.getSpots = function getSpots (_, res,__){ Spot.getSpots() .then(function (response) { // Write the response using the utility function @@ -30,7 +30,7 @@ module.exports.getSpots = function getSpots (req, res, next) { }; //Function to handle modifying an existing parking spot -module.exports.modifySpot = function modifySpot (req, res, next, body, address, type, charger, id) { +module.exports.modifySpot = function modifySpot (_, res,__, body, address, type, charger, id) { Spot.modifySpot(body, address, type, charger, id) .then(function (response) { // Write the response using the utility function @@ -43,7 +43,7 @@ module.exports.modifySpot = function modifySpot (req, res, next, body, address, }; // Function to handle removing a parking spot -module.exports.removeSpot = function removeSpot (req, res, next, id) { +module.exports.removeSpot = function removeSpot (_, res, __, id) { Spot.removeSpot(id) .then(function (response) { // Write the response using the utility function @@ -56,7 +56,7 @@ module.exports.removeSpot = function removeSpot (req, res, next, id) { }; //Function to handle searching for a parking spot -module.exports.searchSpot = function searchSpot (req, res, next, address, type, charger) { +module.exports.searchSpot = function searchSpot (_, res, __, address, type, charger) { Spot.searchSpot(address, type, charger) .then(function (response) { // Write the response using the utility function @@ -66,4 +66,4 @@ module.exports.searchSpot = function searchSpot (req, res, next, address, type, // Write the error response using the utility function utils.writeJson(res, response); }); -}; +}; \ No newline at end of file diff --git a/controllers/SpotOwner.js b/controllers/SpotOwner.js index b916a95..66bb84d 100644 --- a/controllers/SpotOwner.js +++ b/controllers/SpotOwner.js @@ -4,7 +4,7 @@ var utils = require('../utils/writer.js'); var SpotOwner = require('../service/SpotOwnerService'); //Function to handle adding a new spot owner -module.exports.addSpotOwner = function addSpotOwner (req, res, next, body) { +module.exports.addSpotOwner = function addSpotOwner (_, res, __, body){ SpotOwner.addSpotOwner(body) .then(function (response) { // Write the response using the utility function diff --git a/cypress.config.js b/cypress.config.js index 97f47c4..b1d06ac 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -2,8 +2,8 @@ const { defineConfig } = require("cypress"); module.exports = defineConfig({ e2e: { - setupNodeEvents(on, config) { + setupNodeEvents(_ ,__) { // implement node event listeners here }, }, -}); +}); \ No newline at end of file diff --git a/service/LicensePlateService.js b/service/LicensePlateService.js index abcd991..a8d0be2 100644 --- a/service/LicensePlateService.js +++ b/service/LicensePlateService.js @@ -103,5 +103,4 @@ exports.registerPlate = function(body) { resolve(); }); -}; - +}; \ No newline at end of file diff --git a/service/ReservationService.js b/service/ReservationService.js index abb4437..ba3a170 100644 --- a/service/ReservationService.js +++ b/service/ReservationService.js @@ -8,8 +8,8 @@ * id Integer * no response value expected for this operation **/ -exports.deleteReservation = function(id) { - return new Promise(function(resolve, reject) { +exports.deleteReservation = function(_) { + return new Promise(function(resolve, _ /*reject*/) { resolve(); }); } @@ -112,7 +112,7 @@ exports.makeReservation = function(body) { * id Integer * no response value expected for this operation **/ -exports.modifyReservation = function(body,spotId,userId,startTime,duration,date,id) { +exports.modifyReservation = function(body,spotId,userId,_ /*startTime*/ ,_duration ,_date,id) { return new Promise(function(resolve, reject) { // // Η ημερομηνία της κράτησης πρεπει να είναι string (τύπος date) @@ -182,4 +182,3 @@ exports.modifyReservation = function(body,spotId,userId,startTime,duration,date, resolve(); }); } - diff --git a/service/SpotOwnerService.js b/service/SpotOwnerService.js index a0ab805..2397334 100644 --- a/service/SpotOwnerService.js +++ b/service/SpotOwnerService.js @@ -7,10 +7,8 @@ **/ exports.addSpotOwner = function(body) { return new Promise((resolve, reject) => { - //idNumber = αριθμός ταυτότητας //spots = μια λίστα που περιέχει τις θέσεις που ανήκουν στον ιδιοκτήτη θέσεων. - // Ορίζω κανόνες εγκυρότητας για κάθε field του Ιδιοκτήτη θέσεων. //Αν το id δεν είναι θετικός ακέραιος τότε έχω σφάλμα με κωδικό 400. //Αν το idNumber δεν είναι string τότε έχω σφάλμα με κωδικό 400. Το ίδιο ισχύει και για τα name και email. diff --git a/service/SpotService.js b/service/SpotService.js index 70446f3..6cf3096 100644 --- a/service/SpotService.js +++ b/service/SpotService.js @@ -68,7 +68,7 @@ exports.createSpot = function (body) { * returns List **/ exports.getSpots = function () { - return new Promise(function (resolve, /**reject*/) { // reject is unused + return new Promise(function (resolve, _ /*reject*/) { var examples = {}; examples['application/json'] = [{ "address": "address", @@ -169,8 +169,8 @@ exports.modifySpot = function (body, address, type, charger, id) { * no response value expected for this operation **/ exports.removeSpot = function (id) { - return new Promise(function (resolve, reject) { - resolve(); // Διαγράφει τη θέση από το σύστημα + return new Promise(function (resolve, _ /*reject*/) { + resolve(); }); }