Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
const companyRepository = require("../repositories/company.repository");
async function fetchCompanyProfile() {
const users = await companyRepository.fetchUsers();
const employees = await companyRepository.fetchEmployees();
const companyUsers = [];
for (let user of users) {
companyUsers.push({
id: user.id,
name: user.login,
});
}
const companyEmployees = [];
for (let employee of employees) {
companyEmployees.push({
id: parseInt(employee.id),
name: employee.employee_name,
});
}
return {
companyName: "Facebook Inc",
companyUsers,
companyEmployees,
};
}
module.exports = {
fetchCompanyProfile,
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment