Skip to content

Commit 457abbc

Browse files
committed
fix image moderation api and temp_dir field mapping
Add missing unprefixed field names ('api', 'temp_dir') to the image moderation settings mapping to properly handle backend responses that send both prefixed and unprefixed field names.
1 parent 459a4f8 commit 457abbc

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/hooks/useGenericSettings.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ const extractSettingsForGroup = (settings: any, groupName: string) => {
4949
// Map backend fields to prefixed ones that the form expects
5050
// Based on the actual backend response, backend sends both prefixed and unprefixed versions
5151
const imageModerationMappings: Record<string, string[]> = {
52-
'image_moderation_api': ['image_moderation_api'],
52+
'image_moderation_api': ['image_moderation_api', 'api'],
5353
'image_moderation_check_interval': ['image_moderation_check_interval_seconds', 'check_interval_seconds'],
5454
'image_moderation_concurrency': ['image_moderation_concurrency', 'concurrency'],
5555
'image_moderation_enabled': ['image_moderation_enabled', 'enabled'],
5656
'image_moderation_mode': ['image_moderation_mode', 'mode'],
57-
'image_moderation_temp_dir': ['image_moderation_temp_dir'],
57+
'image_moderation_temp_dir': ['image_moderation_temp_dir', 'temp_dir'],
5858
'image_moderation_threshold': ['image_moderation_threshold', 'threshold'],
5959
'image_moderation_timeout': ['image_moderation_timeout_seconds', 'timeout_seconds']
6060
};

0 commit comments

Comments
 (0)