Skip to content

Commit e29301e

Browse files
committed
small fix on PR topcoder-archive#449 for issue topcoder-archive#448
1 parent 54055a2 commit e29301e

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)