Skip to content

Commit

Permalink
Merge pull request #535 from sparcs-kaist/#534-fix-gettaxifare-endpoint
Browse files Browse the repository at this point in the history
#534 [Bug] 네이버 지도 API Credentials가 존재하지 않을 때의 잘못된 동작
  • Loading branch information
kmc7468 authored Aug 20, 2024
2 parents ed177db + bdb4889 commit 5ca7315
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions src/modules/fare.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ const scaledTime = (time) => {
const initializeDatabase = async () => {
try {
if (
naverMapApi["X-NCP-APIGW-API-KEY"] === undefined ||
naverMapApi["X-NCP-APIGW-API-KEY-ID"] === undefined
!naverMapApi["X-NCP-APIGW-API-KEY"] ||
!naverMapApi["X-NCP-APIGW-API-KEY-ID"]
) {
logger.error(
"There is no credential for Naver Map. Taxi Fare functions are disabled."
Expand Down Expand Up @@ -126,8 +126,8 @@ const initializeDatabase = async () => {
*/
const updateTaxiFare = async (sTime, isMajor) => {
if (
naverMapApi["X-NCP-APIGW-API-KEY"] === undefined ||
naverMapApi["X-NCP-APIGW-API-KEY-ID"] === undefined
!naverMapApi["X-NCP-APIGW-API-KEY"] ||
!naverMapApi["X-NCP-APIGW-API-KEY-ID"]
) {
logger.error(
"There is no credential for Naver Map. Taxi Fare functions are disabled."
Expand Down Expand Up @@ -169,8 +169,8 @@ const updateTaxiFare = async (sTime, isMajor) => {
*/
const callTaxiFare = async (from, to) => {
if (
naverMapApi["X-NCP-APIGW-API-KEY"] === undefined ||
naverMapApi["X-NCP-APIGW-API-KEY-ID"] === undefined
!naverMapApi["X-NCP-APIGW-API-KEY"] ||
!naverMapApi["X-NCP-APIGW-API-KEY-ID"]
) {
logger.error(
"There is no credential for Naver Map. Taxi Fare functions are disabled."
Expand Down
4 changes: 2 additions & 2 deletions src/services/fare.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ const naverMapApi = {
const getTaxiFareHandler = async (req, res) => {
try {
if (
naverMapApi["X-NCP-APIGW-API-KEY"] === false ||
naverMapApi["X-NCP-APIGW-API-KEY-ID"] === false
!naverMapApi["X-NCP-APIGW-API-KEY"] ||
!naverMapApi["X-NCP-APIGW-API-KEY-ID"]
) {
return res.status(503).json({
error: "fare/getTaxiFareHandler: Naver Map API credential not found",
Expand Down

0 comments on commit 5ca7315

Please sign in to comment.