Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

small fix on PR #449 for issue #448 #451

Merged
merged 1 commit into from
May 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/controllers/GitlabController.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ async function deleteUsersFromTeam(req, res) {
// If groupInDB not exists, then just return
if (groupInDB) {
try {
const ownerUser = await helper.queryOneUserByTypeAndRole(User,
const ownerUser = await dbHelper.queryOneUserByTypeAndRole(User,
groupInDB.ownerUsername, constants.USER_TYPES.GITLAB, constants.USER_ROLES.OWNER);
if (!ownerUser) {
throw new errors.NotFoundError('The owner user is not found or not accessible.');
Expand Down
5 changes: 4 additions & 1 deletion src/services/ProjectService.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,11 @@ async function _createOrMigrateRepository(repoUrl, project, currentUser) {
await dbHelper.update(models.Repository, oldRepo.id, {projectId: project.id, archived: false});
await Promise.all(issueIds.map(issueId => dbHelper.update(models.Issue, issueId, {projectId: project.id})));
await Promise.all(
paymentIds.map(paymentId => dbHelper.update(models.CopilotPayment, paymentId, {project: project.id}))
paymentIds.filter(paymentId => paymentId)
.map(paymentId => dbHelper.update(models.CopilotPayment, paymentId, {project: project.id}))
);

await createHook({projectId: project.id}, currentUser, repoUrl);
}
catch (err) {
throw new Error(`Update ProjectId for Repository, Issue, CopilotPayment failed. Repo ${repoUrl}. Internal Error: ${err}`);
Expand Down