1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-02-21 15:54:22 +01:00

(bug) unable to udpate some settings

This commit is contained in:
Sylvain 2023-01-03 10:36:45 +01:00
parent 21f97ff1c5
commit 3ec88c8f5f

View File

@ -42,6 +42,7 @@ class SettingService
def notify_privacy_update(settings) def notify_privacy_update(settings)
return unless settings.any? { |s| s.name == 'privacy_body' } return unless settings.any? { |s| s.name == 'privacy_body' }
setting = settings.find { |s| s.name == 'privacy_body' }
NotifyPrivacyUpdateWorker.perform_async(setting.id) NotifyPrivacyUpdateWorker.perform_async(setting.id)
end end
@ -49,6 +50,7 @@ class SettingService
def sync_stripe_objects(settings) def sync_stripe_objects(settings)
return unless (%w[stripe_secret_key online_payment_module] & settings.map(&:name)).count.positive? return unless (%w[stripe_secret_key online_payment_module] & settings.map(&:name)).count.positive?
setting = settings.find { |s| s.name == 'stripe_secret_key' }
SyncObjectsOnStripeWorker.perform_async(setting.history_values.last&.invoicing_profile&.user&.id) SyncObjectsOnStripeWorker.perform_async(setting.history_values.last&.invoicing_profile&.user&.id)
end end
@ -56,6 +58,7 @@ class SettingService
def build_stats(settings) def build_stats(settings)
return unless settings.any? { |s| s.name == 'statistics_module' && s.value == 'true' } return unless settings.any? { |s| s.name == 'statistics_module' && s.value == 'true' }
setting = settings.find { |s| s.name == 'statistics_module' }
PeriodStatisticsWorker.perform_async(setting.previous_update) PeriodStatisticsWorker.perform_async(setting.previous_update)
end end