Skip to content

Instantly share code, notes, and snippets.

@rezaindrag
Created July 2, 2020 09:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rezaindrag/171e7ab859255103908329d3bc2fd769 to your computer and use it in GitHub Desktop.
Save rezaindrag/171e7ab859255103908329d3bc2fd769 to your computer and use it in GitHub Desktop.
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