<?php

require_once '../../core/api_bootstrap.php';
require_once '../../core/provider_auth.php';

$provider_id = ProviderAuth::id();

$data = Request::post();

Validator::required($data,['id']);

$db = new Database();
$conn = $db->connect();

$conn->prepare("

DELETE FROM provider_service_areas

WHERE id=:id
AND provider_id=:provider

")->execute([

':id'=>$data['id'],
':provider'=>$provider_id

]);

Response::success([],"Area removed");