<?php

namespace Saswp\Api\Vendor;
use Saswp\Api;
use Saswp\DTOs\Response\Vendor\LoginJsonDTO;
use Saswp\Settings;
use WP_REST_Request;

class VendorLogoutController
{
    private Api $api;
    private Settings $settings;
    private $apiUrl = "/api/vendor/logout";

    public function __construct(){
        $this->api = new Api();
        $this->settings = new Settings();
    }
    public function __invoke(WP_REST_Request $wpRestRequest):array
    {
        session_start();
        unset($_SESSION['saswp_vendor_token']);
        unset($_SESSION['saswp_vendor_id']);
        return [
            "success"=> true,
            "message" => "Logged out"
        ];
    }


}
