Skip to content

Commit

Permalink
remove useless fields #2323
Browse files Browse the repository at this point in the history
  • Loading branch information
sfinx13 committed Mar 7, 2024
1 parent 66a515c commit 53bea91
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Service/Oilhi/HookZapierService.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public function __construct(
public function pushDossier(DossierMessage $dossierMessage): ResponseInterface|JsonResponse
{
$payload = $this->normalizer->normalize($dossierMessage);
$payload = $this->removeUselessFields($payload);
$payload['token'] = $this->token;
$options = [
'headers' => [
Expand All @@ -58,4 +59,15 @@ public function pushDossier(DossierMessage $dossierMessage): ResponseInterface|J

return (new JsonResponse($response))->setStatusCode(Response::HTTP_SERVICE_UNAVAILABLE);
}

/**
* Utile pour le traitement interne mais inutile à l'enregistrement dans Airtable.
*/
private function removeUselessFields(array $payload): array
{
unset($payload['signalementId']);
unset($payload['partnerId']);

return $payload;
}
}

0 comments on commit 53bea91

Please sign in to comment.