Skip to content

Commit

Permalink
fixed 'repo id' error
Browse files Browse the repository at this point in the history
  • Loading branch information
kaxada committed Dec 15, 2023
1 parent 97e4248 commit 90fc745
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,6 @@ web_modules/

# dotenv environment variable files
.env*
.env.development.local
.env.test.local
.env.production.local
.env.local
!.env.development

# parcel-bundler cache (https://parceljs.org/)
.cache
Expand Down
5 changes: 3 additions & 2 deletions routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const reposToBadge = async (req, res) => {
const selectedRepos = (await req.body.repos) || [];
const userId = req.body.userId;
const provider = req.body.provider;
const repositoryIds = selectedRepos.map((repo) => repo.id);

if (!provider) {
res.status(400).send("provider missing");
Expand Down Expand Up @@ -59,15 +60,15 @@ const reposToBadge = async (req, res) => {
user.id,
user.name,
user.email,
selectedRepos
repositoryIds
);
res.status(200).json({ results });
} else if (provider === "gitlab") {
const results = await gitlab_helpers.scanRepositories(
user.id,
user.name,
user.email,
selectedRepos
repositoryIds
);
res.status(200).json({ results });
} else {
Expand Down

0 comments on commit 90fc745

Please sign in to comment.