Skip to content
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
6 changes: 6 additions & 0 deletions backend/src/database/repositories/settingsRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ export default class SettingsRepository {

data.backgroundImageUrl = _get(data, 'backgroundImages[0].downloadUrl', null)
data.logoUrl = _get(data, 'logos[0].downloadUrl', null)
if (
typeof data.slackWebhook !== 'string' ||
(typeof data.slackWebhook === 'string' && !data.slackWebHook?.startsWith('https://'))
) {
data.slackWebHook = undefined
}

const [settings] = await options.database.settings.findOrCreate({
where: { id: tenant.id, tenantId: tenant.id },
Expand Down
3 changes: 3 additions & 0 deletions backend/src/services/settingsService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class SettingsService {
const updated = await SettingsRepository.save(
{
...options.currentTenant.settings[0].dataValues,
slackWebHook: undefined,
customActivityTypes: activityTypes.custom,
},
options,
Expand Down Expand Up @@ -140,6 +141,7 @@ class SettingsService {
const updated = await SettingsRepository.save(
{
...options.currentTenant.settings[0].dataValues,
slackWebHook: undefined,
customActivityTypes: activityTypes.custom,
},
options,
Expand All @@ -158,6 +160,7 @@ class SettingsService {
const updated = await SettingsRepository.save(
{
...options.currentTenant.settings[0].dataValues,
slackWebHook: undefined,
customActivityTypes: activityTypes.custom,
},
options,
Expand Down