diff --git a/application/modules/history/history.controller.js b/application/modules/history/history.controller.js index 9ae81ac..bf3e5f6 100644 --- a/application/modules/history/history.controller.js +++ b/application/modules/history/history.controller.js @@ -1,9 +1,13 @@ const { param, body, validationResult } = require("express-validator"); +const helper = require("../../helpers/helper"); const winston = require("../../helpers/winston.logger"); const model = require("./history.model"); const moment = require("moment"); moment.locale("id"); +var result = {}; +var uniqueCode; + // VALIDATION const validate = (method) => { switch (method) { @@ -54,7 +58,7 @@ const history = async (req, res) => { let getPartner = await model.getPartner(mid, tid); if (!getPartner) { return res.status(200).json({ - code: "403", + code: "412", message: "terminal id is not valid", data: {}, }); @@ -71,7 +75,7 @@ const history = async (req, res) => { if (!result) { return res.status(200).json({ - code: "403", + code: "422", message: "history doesn't exist", data: [], }); @@ -83,9 +87,6 @@ const history = async (req, res) => { data: result, }); } catch (error) { - // create log - winston.logger.error(`${error.message}`); - return res.status(200).json({ code: "500", message: diff --git a/application/modules/loadbalance/loadbalance.controller.js b/application/modules/loadbalance/loadbalance.controller.js index 9d2d751..3a9ec2a 100644 --- a/application/modules/loadbalance/loadbalance.controller.js +++ b/application/modules/loadbalance/loadbalance.controller.js @@ -785,11 +785,6 @@ const inquiryLoadingBalance = async (req, res) => { }); } } catch (error) { - // create log - winston.logger.error( - `500 internal server error - backend server | ${error.message}` - ); - return res.status(200).json({ code: "500", message: diff --git a/application/modules/reservebalance/reservebalance.controller.js b/application/modules/reservebalance/reservebalance.controller.js index 1db2add..aeba9d2 100644 --- a/application/modules/reservebalance/reservebalance.controller.js +++ b/application/modules/reservebalance/reservebalance.controller.js @@ -423,7 +423,7 @@ const inquiryReservation = async (req, res) => { // validation parameter inquiry if (!reservation_number && !card_number) { return res.status(200).json({ - code: "403", + code: "400", message: "bad request. please add the reservation number or card number!", data: {}, @@ -433,7 +433,7 @@ const inquiryReservation = async (req, res) => { // validation inquiry date if ((!start_date && end_date) || (start_date && !end_date)) { return res.status(200).json({ - code: "403", + code: "400", message: "bad request. please check the date!", data: {}, }); @@ -480,11 +480,6 @@ const inquiryReservation = async (req, res) => { }); } } catch (error) { - // create log - winston.logger.error( - `500 internal server error - backend server | ${error.message}` - ); - return res.status(200).json({ code: "500", message: