You are here

public function ProgressTrackerController::callback in TMGMT Translator Smartling 8.3

Same name and namespace in other branches
  1. 8.4 src/Controller/ProgressTrackerController.php \Drupal\tmgmt_smartling\Controller\ProgressTrackerController::callback()
1 string reference to 'ProgressTrackerController::callback'
tmgmt_smartling.routing.yml in ./tmgmt_smartling.routing.yml
tmgmt_smartling.routing.yml

File

src/Controller/ProgressTrackerController.php, line 12

Class

ProgressTrackerController

Namespace

Drupal\tmgmt_smartling\Controller

Code

public function callback(Request $request) {
  try {
    $smartling_provider_config = \Drupal::getContainer()
      ->get("tmgmt_smartling.smartling_config_manager")
      ->getConfigByProjectId($request
      ->get("projectId"));
    $api_wrapper = \Drupal::getContainer()
      ->get("tmgmt_smartling.smartling_api_wrapper");
    $api_wrapper
      ->setSettings($smartling_provider_config
      ->get("settings"));
    $api_wrapper
      ->getApi("progress")
      ->deleteRecord($request
      ->get("spaceId"), $request
      ->get("objectId"), $request
      ->get("recordId"));
  } catch (Exception $e) {
    return new Response('Failed', 500);
  }
  return new Response('OK');
}