diff --git a/pages/api/repo/add.js b/pages/api/repo/add.js index 613d7d7..273f72a 100644 --- a/pages/api/repo/add.js +++ b/pages/api/repo/add.js @@ -17,8 +17,8 @@ export default async function handler(req, res) { //The data we expect to receive const { alias, sshPublicKey, size, comment, alert, lanCommand } = req.body; - //We check that we receive data for each variable. Only "comment" is optional in the form. - if (!alias || !sshPublicKey || !size || !alert || !lanCommand) { + //We check that we receive data for each variable. Only "comment" and "lanCommand" are optional in the form. + if (!alias || !sshPublicKey || !size || !alert) { //If a variable is empty. res.status(422).json({ message: 'Unexpected data', diff --git a/pages/api/repo/id/[slug]/edit.js b/pages/api/repo/id/[slug]/edit.js index 7fe6d4b..f70b9e1 100644 --- a/pages/api/repo/id/[slug]/edit.js +++ b/pages/api/repo/id/[slug]/edit.js @@ -17,8 +17,8 @@ export default async function handler(req, res) { //The data we expect to receive const { alias, sshPublicKey, size, comment, alert, lanCommand } = req.body; - //We check that we receive data for each variable. Only "comment" is optional in the form. - if (!alias || !sshPublicKey || !size || !alert || !lanCommand) { + //We check that we receive data for each variable. Only "comment" and "lanCommand" are optional in the form. + if (!alias || !sshPublicKey || !size || !alert) { //If a variable is empty. res.status(422).json({ message: 'Unexpected data',