Skip to content

Commit

Permalink
made some changes to dashboard and zoom
Browse files Browse the repository at this point in the history
  • Loading branch information
aaditya47 committed Feb 26, 2021
1 parent 2f95cd5 commit a8c361e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 10 deletions.
16 changes: 8 additions & 8 deletions routes/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,20 @@ const bcrypt = require("bcryptjs");
const jwt = require("jsonwebtoken");
const keys = require("../config/keys");

const zoom=require("../zoom");

// Loading schemas
const User = require("../models/UserSchema");
const Requested = require("../models/RequestedSchema");
const Todo = require("../models/TodoSchema");
const Inprogress = require("../models/InprogressSchema");
const Done = require("../models/DoneSchema");

const zoom=require("../zoom");
function checkName(name) {
temp=name.split('@');
const temp=name.split('@');
if(temp[0]=="Zoom")
{
return True;
return true;
}
return False;
return false;
}

// Endpoints to populate db
Expand All @@ -44,8 +42,10 @@ router.post("/dashboard/inprogress", (req,res) => {
newTask.save().then(res.json(req.body.name)).catch(err => console.log(err));
if(checkName(req.body.name))
{
temp=(req.body.name).split('@'); // specify data format = YYYY-MM-DDTHH:MM:SSZ
zoom.StartZoomMeeting(temp[1],temp[2],temp[3]);
const temp=req.body.name; // specify data format = YYYY-MM-DDTHH:MM:SSZ
console.log(temp);
const format=temp.split('@');
zoom.StartZoomMeeting(format[1],format[2]);
}
});

Expand Down
18 changes: 16 additions & 2 deletions zoom.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
const config = require('./config/config');
const agenda=require("./agenda");
const User = require("./models/UserSchema");

module.exports = async function StartZoomMeeting(topicname,date,time) {
function test()
{
console.log("Test");
}

async function StartZoomMeeting(topicname,date) {
const email=User.find({
"email":email
},(err,teams) => {
console.log(err);
});
console.log(email);
const options = {
method: "POST",
uri: "https://api.zoom.us/v2/users/" + email + "/meetings",
body: {
topic: topicname,
start_time: date+"-"+time,
start_time: date,
type: 1,
settings: {
host_video: "true",
Expand Down Expand Up @@ -37,3 +49,5 @@ module.exports = async function StartZoomMeeting(topicname,date,time) {
console.log("API call failed, reason ", error);
}
}

module.exports.StartZoomMeeting=StartZoomMeeting;

0 comments on commit a8c361e

Please sign in to comment.