Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
abhudaym committed Feb 28, 2021
1 parent d900785 commit 25e6e24
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions controllers/userController.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ const updateCircle = asyncHandler(async (req, res) => {
user.circle.push(user2);
user.save();

const data = await axios.get(`http://ip-api.com/json`);
console.log(data);
const lat = data.data.lat;
const lon = data.data.lon;

res.json({
name: user.name,
email: user.email,
Expand Down
1 change: 1 addition & 0 deletions routes/userRoutes.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
import { protectHospital, protectUser } from "../middleware/authMiddleware.js";

const router = express.Router();
router.route("/").get(getUsers).put(registerUser);
router.route("/circle").post(protectUser, updateCircle);
router.route("/SOS").put(protectUser, SOS);
router.post("/login", authUser);
Expand Down

0 comments on commit 25e6e24

Please sign in to comment.