Skip to content

Commit 0f27fcd

Browse files
committed
fix: linter and prettier
1 parent a094b5b commit 0f27fcd

1 file changed

Lines changed: 9 additions & 14 deletions

File tree

backend/src/services/segmentService.ts

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -244,38 +244,33 @@ export default class SegmentService extends LoggerBase {
244244
const qx = SequelizeRepository.getQueryExecutor({ ...this.options, transaction })
245245

246246
try {
247-
const subproject = await this.createSubprojectInternal(
248-
data,
249-
qx,
247+
const subproject = await this.createSubprojectInternal(data, qx, transaction)
248+
249+
const orgIds = await this.blockOrganizationAffiliationIfSegmentNameMatches(
250+
data.name,
250251
transaction,
251252
)
252-
253-
const orgIds =
254-
await this.blockOrganizationAffiliationIfSegmentNameMatches(
255-
data.name,
256-
transaction,
257-
)
258-
253+
259254
await SequelizeRepository.commitTransaction(transaction)
260-
255+
261256
if (orgIds?.length) {
262257
const organizationService = new OrganizationService(this.options)
263-
258+
264259
for (const orgId of orgIds) {
265260
await organizationService.startOrganizationUpdateWorkflow(orgId, {
266261
syncToOpensearch: true,
267262
recalculateAffiliations: true,
268263
})
269264
}
270265
}
271-
266+
272267
return await this.findById(subproject.id)
273268
} catch (error) {
274269
await SequelizeRepository.rollbackTransaction(transaction)
275270
throw error
276271
}
277272
}
278-
273+
279274
async createSubprojectInternal(
280275
data: SegmentData,
281276
qx: QueryExecutor,

0 commit comments

Comments
 (0)