Skip to content

Commit

Permalink
Merge pull request #26 from matheuspiment/development
Browse files Browse the repository at this point in the history
Small fixes
  • Loading branch information
matheuspiment authored Oct 9, 2019
2 parents 474a113 + ac10c41 commit 28c12bc
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .huskyrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"hooks": {
"pre-commit": "test && lint-staged"
"pre-commit": "yarn lint-staged"
}
},
}
4 changes: 2 additions & 2 deletions __tests__/helpers/MongooseConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import '../../src/bootstrap'
import mongoose from 'mongoose'

class MongooseConnection {
async connect (testSuitName: string): Promise<void> {
mongoose.connect(`${process.env.MONGO_URI}-${testSuitName}`, {
async connect (testSuiteName: string): Promise<void> {
mongoose.connect(`${process.env.MONGO_URI}-${testSuiteName}`, {
useNewUrlParser: true,
useUnifiedTopology: true,
useCreateIndex: true
Expand Down
6 changes: 3 additions & 3 deletions src/controllers/CityController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as Yup from 'yup'
import axios from 'axios'
import map from 'lodash/map'

import { GoogleMapPrediction } from '../types'
import { GoogleMapsPrediction } from '../types'
import googleMapsConfig from '../config/googleMaps'

class CityController {
Expand All @@ -19,7 +19,7 @@ class CityController {
params: {
input: req.query.search,
types: '(cities)',
language: 'es_US',
language: 'en_US',
key: process.env.GOOGLE_MAPS_API_KEY
}
})
Expand All @@ -30,7 +30,7 @@ class CityController {

const normalizedCities = map(
response.data.predictions,
(prediction: GoogleMapPrediction) => prediction.description
(prediction: GoogleMapsPrediction) => prediction.description
)

return res.status(200).json({ cities: normalizedCities })
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ export interface AuthRequest extends Request {
userId: string
}

export interface GoogleMapPrediction {
export interface GoogleMapsPrediction {
description: string
}

0 comments on commit 28c12bc

Please sign in to comment.