diff --git a/CHANGELOG.md b/CHANGELOG.md index c66ba48..0ca6a1a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ All notable changes to `unifi-access-api` will be documented in this file +# 1.1.2 - 2025-10-25 + +**New features:** +- Update visitor delete method to allow force delete + ## 1.1.1 - 2025-10-23 **Breaking:** diff --git a/src/API/VisitorClient.php b/src/API/VisitorClient.php index 4e28e7f..3498481 100644 --- a/src/API/VisitorClient.php +++ b/src/API/VisitorClient.php @@ -92,13 +92,15 @@ public function assignQrCode(UuidV4 $visitorId): UnifiResponse } /** + * @param bool $force If is_force is passed, physically delete this visitor; otherwise, update to canceled status. + * * @throws InvalidResponseException * @throws GuzzleException * @throws UnifiApiErrorException */ - public function delete(UuidV4 $visitorId): UnifiResponse + public function delete(UuidV4 $visitorId, bool $force = false): UnifiResponse { - $response = $this->client->delete($this::ENDPOINT."/{$visitorId->getValue()}"); + $response = $this->client->delete($this::ENDPOINT."/{$visitorId->getValue()}?is_force={($force ? 'true' : 'false')}"); $data = json_decode($response->getBody()->getContents(), true);