yxcyc
This commit is contained in:
@@ -181,6 +181,11 @@ final class Router
|
||||
Http::json(['data' => $this->createMeasurement($projectKey, Http::input())], 201);
|
||||
}
|
||||
|
||||
if (preg_match('~^measurements/(\d+)$~', $resource, $matches) && $method === 'DELETE') {
|
||||
$this->deleteMeasurement($projectKey, (int) $matches[1]);
|
||||
Http::json(['data' => ['deleted' => true]]);
|
||||
}
|
||||
|
||||
if ($resource === 'measurements-import' && $method === 'POST') {
|
||||
$this->repository()->ensureProject($projectKey);
|
||||
Http::json(['data' => $this->importMeasurements($projectKey, Http::input())], 201);
|
||||
@@ -1454,6 +1459,15 @@ final class Router
|
||||
];
|
||||
}
|
||||
|
||||
private function deleteMeasurement(string $projectKey, int $measurementId): void
|
||||
{
|
||||
if ($measurementId <= 0) {
|
||||
throw new ApiException('measurement_id ist ungueltig.', 422);
|
||||
}
|
||||
|
||||
$this->repository()->deleteMeasurement($projectKey, $measurementId);
|
||||
}
|
||||
|
||||
private function syncCurrencyCatalogForMeasurement(array $payload): void
|
||||
{
|
||||
$priceCurrency = strtoupper(trim((string) ($payload['price_currency'] ?? '')));
|
||||
|
||||
Reference in New Issue
Block a user