Created
July 2, 2020 09:33
-
-
Save rezaindrag/171e7ab859255103908329d3bc2fd769 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const companyService = require("../services/company.service"); | |
async function fetchCompanyProfile(req, res) { | |
try { | |
const companyProfile = await companyService.fetchCompanyProfile(); | |
res.json(companyProfile); | |
} catch (e) { | |
errorResponse(e, res); | |
} | |
} | |
function errorResponse(e, res) { | |
res.status(e.response.statusCode).json({ message: e.response.body.message }); | |
} | |
module.exports = { | |
fetchCompanyProfile, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment