<?php
if (!defined('ABSPATH')) exit; // Exit if accessed directly
use AC_SYNC\Includes\Classes\Api\Action_Wear_Api_Route;
use AC_SYNC\Includes\Classes\Api\Action_Wear_API_Response as ApiResponse;
use AC_SYNC\Includes\Classes\Address\Action_Wear_Address as Address;

$route = new Action_Wear_Api_Route("/get_addresses");
$route->setMethods("GET");
$route->setCallback(function () {
    $response = new ApiResponse();
    $addresses = Address::getAll();
    $response->success([
        "addresses" => $addresses
    ]);
    return $response->getResponse();
});
$route->registerRoute();
