{"size": 579, "ext": "js", "max_stars_repo_path": "pages/api/room/requests/index.js", "max_stars_repo_name": "Abdelfetah-Dev/chat-app", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "pages/api/room/requests/index.js", "max_issues_repo_name": "Abdelfetah-Dev/chat-app", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "pages/api/room/requests/index.js", "max_forks_repo_name": "Abdelfetah-Dev/chat-app", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 27.5714285714, "max_line_length": 89, "alphanum_fraction": 0.493955095}
var { auth: { get_user },room:{ get_requests } } = require("../../../../lib/db_querys");

export default function handler(req, res) {
    if(req.method === 'POST'){
        var { access_token,room_id } = req.body;
        var data = { access_token,room_id };
        get_requests(data,(qerr,requests)=>{
            if(qerr){
                throw qerr;
            }else{
                res.status(200).json({status:"success",requests});
            }
        });
    }else{
        res.status(200).json({message:"you are in the wrong place!"});
    }
}



