Browse Source

Refactored /org/repositories/:name route

pull/28/head
Peter Morgan 4 years ago
parent
commit
16d94f6094
1 changed files with 9 additions and 12 deletions
  1. +9
    -12
      routes/api/v2.js

+ 9
- 12
routes/api/v2.js View File

@ -265,18 +265,15 @@ routes.get("/repositories/:name", async (req, res) => {
});
routes.get("/org/repositories/:name", (request, result)=>
{
queryRepositories(request.params.name, API_ORGS_PATH).then(repos=>
{
result.json(repos)
.end();
}).catch(error=>
{
result.status(500)
.json({error: 'API error fetching friends'})
.end();
});
routes.get("/org/repositories/:name", async (req, res) => {
try {
const repos = await queryRepositories(req.params.name, API_ORGS_PATH);
res.json(repos).end();
} catch (error) {
res.status(500)
.json({error: 'API error fetching friends'})
.end();
}
});

Loading…
Cancel
Save