Skip to content

Instantly share code, notes, and snippets.

@rezaindrag
Created July 2, 2020 09:33
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
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