Skip to content

Commit

Permalink
fixed error
Browse files Browse the repository at this point in the history
  • Loading branch information
abdel-lall committed Dec 21, 2023
1 parent 4a096df commit 62b4ff3
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions src/controllers/profileInitialSetupController.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,18 @@ const profileInitialSetupController = function (
) {
const { JWT_SECRET } = config;

const setMapLocation = async (locationData) => {

const location = new MapLocation(locationData);

try {
const response = await location.save()
return response
} catch (err) {
return {type: "Error", message: err.message || 'An error occurred while saving the location'}
}
}

/*
Function to handle token generation and email process:
- Generates a new token and saves it to the database.
Expand Down Expand Up @@ -319,17 +331,7 @@ const profileInitialSetupController = function (
}
};

const setMapLocation = async (locationData) => {

const location = new MapLocation(locationData);

try {
const response = await location.save()
return response
} catch (err) {
return {type: "Error", message: err.message || 'An error occurred while saving the location'}
}
}

return {
getSetupToken,
Expand Down

0 comments on commit 62b4ff3

Please sign in to comment.