add wake on lan

This commit is contained in:
Nikola Petrov
2023-10-12 22:21:55 +02:00
parent 51723f029c
commit 6d3dcc773d
6 changed files with 42 additions and 20 deletions

View File

@@ -3,11 +3,7 @@ var UserModel = require('../models/userModel');
module.exports = {
create: async function (req, res) {
console.log(req.body);
const pass = req.body.password;
const omdb_key = req.body.omdb_key;
const twitch_client_id = req.body.twitch_client_id;
const twitch_client_secret = req.body.twitch_client_secret;
const pass = req.body.pass;
try {
const userFound = await UserModel.findOne({ pass: pass });
@@ -16,10 +12,11 @@ module.exports = {
}
const user = new UserModel({
pass: pass,
omdb_key: omdb_key,
twitch_client_id: twitch_client_id,
twitch_client_secret: twitch_client_secret,
pass,
omdb_key: req.body.omdb_key,
twitch_client_id: req.body.twitch_client_id,
twitch_client_secret: req.body.twitch_client_secret,
mac_address: req.body.mac_address,
});
await user.save();
@@ -30,9 +27,6 @@ module.exports = {
}
},
/**
* mediaController.delete()
*/
remove: async function (req, res) {
try {
await userFound.remove();