Skip to content

Commit bcdb84f

Browse files
author
Uroš Marolt
committed
bugfix for slack commands
1 parent 501ee6b commit bcdb84f

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

backend/src/database/repositories/tenantRepository.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,9 @@ class TenantRepository {
151151
'onboardedAt',
152152
'hasSampleData',
153153
'importHash',
154+
'plan',
155+
'isTrialPlan',
156+
'trialEndsAt',
154157
]),
155158
updatedById: currentUser.id,
156159
},

backend/src/services/slackCommandService.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export default class SlackCommandService {
8585
if (!tenant) {
8686
sections.push(Section({ text: `*Tenant with ID ${tenantId} not found!*` }))
8787
} else {
88-
await TenantRepository.update(
88+
const result = await TenantRepository.update(
8989
tenantId,
9090
{
9191
plan,
@@ -97,11 +97,9 @@ export default class SlackCommandService {
9797
)
9898
sections.push(
9999
Section({
100-
text: `*Tenant ${
101-
tenant.name
102-
} (${tenantId}) plan changed to ${plan}, trial=${isTrial}, trialEndsAt=${
103-
trialEndsAt ?? '<unset>'
104-
}!*`,
100+
text: `*Tenant ${tenant.name} (${tenantId}) plan changed to ${result.plan}, trial=${
101+
result.isTrialPlan
102+
}, trialEndsAt=${result.trialEndsAt ?? '<unset>'}!*`,
105103
}),
106104
)
107105
}

0 commit comments

Comments
 (0)