<?php

require_once "lib/survey.php";

function endpoint($endpoint_data): array
{
    return match ($endpoint_data["action"]) {
        "surveySubmit" => submitSurvey($endpoint_data["satisfaction"], $endpoint_data["functionality"], $endpoint_data["content"], $endpoint_data["comment"]),
        default => ["Status" => "Fail", "message" => "Invalid action"],
    };
}