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

Commit 595d71c

Browse files
authored
Merge pull request #451 from 52cs/issue-448-fix
small fix on PR #449 for issue #448
2 parents 54055a2 + e29301e commit 595d71c

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/controllers/GitlabController.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ async function deleteUsersFromTeam(req, res) {
263263
// If groupInDB not exists, then just return
264264
if (groupInDB) {
265265
try {
266-
const ownerUser = await helper.queryOneUserByTypeAndRole(User,
266+
const ownerUser = await dbHelper.queryOneUserByTypeAndRole(User,
267267
groupInDB.ownerUsername, constants.USER_TYPES.GITLAB, constants.USER_ROLES.OWNER);
268268
if (!ownerUser) {
269269
throw new errors.NotFoundError('The owner user is not found or not accessible.');

src/services/ProjectService.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,11 @@ async function _createOrMigrateRepository(repoUrl, project, currentUser) {
150150
await dbHelper.update(models.Repository, oldRepo.id, {projectId: project.id, archived: false});
151151
await Promise.all(issueIds.map(issueId => dbHelper.update(models.Issue, issueId, {projectId: project.id})));
152152
await Promise.all(
153-
paymentIds.map(paymentId => dbHelper.update(models.CopilotPayment, paymentId, {project: project.id}))
153+
paymentIds.filter(paymentId => paymentId)
154+
.map(paymentId => dbHelper.update(models.CopilotPayment, paymentId, {project: project.id}))
154155
);
156+
157+
await createHook({projectId: project.id}, currentUser, repoUrl);
155158
}
156159
catch (err) {
157160
throw new Error(`Update ProjectId for Repository, Issue, CopilotPayment failed. Repo ${repoUrl}. Internal Error: ${err}`);

0 commit comments

Comments
 (0)