| @@ -325,27 +325,26 @@ | ||
| 325 | 325 | |
| 326 | 326 | $user = $this->utils('options')->get('user'); |
| 327 | 327 | |
| 328 | 328 | $ai_process_data[$process_id] = [ |
| 329 | - 'name' => $name, | |
| 330 | - 'category' => $category, | |
| 331 | - 'description' => $description, | |
| 332 | - 'email' => $email, | |
| 333 | - 'contactNumber' => $contactNumber, | |
| 334 | - 'businessAddress' => $businessAddress, | |
| 335 | - 'openingHour' => $openingHour, | |
| 336 | - 'process_id' => $process_id, | |
| 337 | - 'pack_id' => $pack_id, | |
| 338 | - 'ai_page_ids' => $ai_page_ids, | |
| 339 | - 'ai_preview_ids' => $preview_pages, | |
| 340 | - 'content_ids' => $content_ids, | |
| 341 | - 'platform' => $platform, | |
| 342 | - 'api_key' => $this->api_key, | |
| 343 | - 'user_id' => isset($user['id']) ? $user['id'] : null, | |
| 344 | - 'session_id' => $session_id, | |
| 345 | - 'imageReplace' => $image_replace, | |
| 346 | - 'language' => $language, | |
| 347 | - 'requested_platform' => $requested_platform, | |
| 329 | + 'name' => $name, | |
| 330 | + 'category' => $category, | |
| 331 | + 'description' => $description, | |
| 332 | + 'email' => $email, | |
| 333 | + 'contactNumber' => $contactNumber, | |
| 334 | + 'businessAddress' => $businessAddress, | |
| 335 | + 'openingHour' => $openingHour, | |
| 336 | + 'process_id' => $process_id, | |
| 337 | + 'pack_id' => $pack_id, | |
| 338 | + 'ai_page_ids' => $ai_page_ids, | |
| 339 | + 'ai_preview_ids' => $preview_pages, | |
| 340 | + 'content_ids' => $content_ids, | |
| 341 | + 'platform' => $platform, | |
| 342 | + 'api_key' => $this->api_key, | |
| 343 | + 'user_id' => isset($user['id']) ? $user['id'] : null, | |
| 344 | + 'session_id' => $session_id, // Store session_id for coordination | |
| 345 | + 'imageReplace' => $image_replace, // Store session_id for coordination | |
| 346 | + 'language' => $language, | |
| 348 | 347 | ]; |
| 349 | 348 | |
| 350 | 349 | // Update using API key-based storage with automatic count-based cleanup |
| 351 | 350 | AIUtils::update_ai_process_data($ai_process_data); |
| @@ -511,11 +510,10 @@ | ||
| 511 | 510 | * @return array|\WP_Error |
| 512 | 511 | */ |
| 513 | 512 | public function get_attachments() { |
| 514 | 513 | // Get parameters from request |
| 515 | - $type = $this->get_param('type', 'pack'); | |
| 516 | - $id = $this->get_param('pack_id'); | |
| 517 | - $requested_platform = $this->get_param('requested_platform', 'templately'); | |
| 514 | + $type = $this->get_param('type', 'pack'); | |
| 515 | + $id = $this->get_param('pack_id'); | |
| 518 | 516 | |
| 519 | 517 | // Require ID parameter - return error if not provided |
| 520 | 518 | if (empty($id)) { |
| 521 | 519 | return $this->error('missing_id', __('Pack ID or ID parameter is required.', 'templately'), 'get_attachments', 400); |
| @@ -526,10 +524,9 @@ | ||
| 526 | 524 | $api_endpoint = "get-xml-attachment/{$type}/{$id}"; |
| 527 | 525 | |
| 528 | 526 | // Make API call |
| 529 | 527 | $extra_headers = [ |
| 530 | - 'Accept' => 'application/xml, text/xml', | |
| 531 | - 'x-templately-requested-platform' => $requested_platform, | |
| 528 | + 'Accept' => 'application/xml, text/xml', | |
| 532 | 529 | ]; |
| 533 | 530 | $response = Helper::make_api_get_request("v2/$api_endpoint", [], $extra_headers, 30); |
| 534 | 531 | |
| 535 | 532 | // Check for HTTP errors |