2525 *
2626 * The form integrates with GitHub-hosted community store data and dispatches background jobs
2727 * to process the selected stores and add them to the discount system.
28- *
2928 */
3029class CommunityStoresForm
3130{
@@ -110,7 +109,7 @@ public static function configure()
110109 Step::make ('Select Domains ' )
111110 ->key ('select-domains ' )
112111 ->schema ([
113- Hidden::make ('domains_selected_files ' ),
112+ Hidden::make ('stores_selected_domains ' ),
114113
115114 // Domain selection with visual checkboxes
116115 // Fetches available domains for the stores selected in previous step
@@ -127,7 +126,7 @@ public static function configure()
127126
128127 $ stores = StoreHelper::get_domains_for_stores ($ customStores );
129128
130- $ set ('domains_selected_files ' , $ stores );
129+ $ set ('stores_selected_domains ' , $ stores );
131130
132131 return $ stores ;
133132 })
@@ -147,9 +146,12 @@ public static function configure()
147146 ->action (function ($ data ) {
148147 // Process selected domains and dispatch background jobs
149148 // Each job adds a store to the discount system with its logo from GitHub
150- foreach ($ data ['domains_selected_files ' ] as $ domain ) {
151- $ image_link = config ('settings.github_community_store_gist_base ' ).$ domain ['store ' ].'/logo.png ' ;
152- AddStoreToDiscountJob::dispatch ($ domain ['path ' ], $ image_link );
149+
150+ foreach ($ data ['domains_selected ' ] as $ domain ) {
151+ $ current_domain = $ data ['stores_selected_domains ' ][$ domain ];
152+
153+ $ image_link = config ('settings.github_community_store_gist_base ' ).$ current_domain ['store ' ].'/logo.png ' ;
154+ AddStoreToDiscountJob::dispatch ($ current_domain ['path ' ], $ image_link );
153155 }
154156
155157 Notification::make ()
0 commit comments