use actix_web::HttpResponse;
use serde::Serialize;

pub fn send_json_http_response<T>(code: String, message: T) -> HttpResponse
where
    T: Serialize,
{
    let json = serde_json::json!({
        "code": code,
        "data": message
    });

    return HttpResponse::Ok().json(json);
}
