mirror of
https://github.com/Ravinou/borgwarehouse
synced 2024-05-26 10:32:21 +02:00
fix: lanCommand is optionnal in form
This commit is contained in:
parent
5f0b47019b
commit
2eca125974
|
@ -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',
|
||||
|
|
|
@ -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',
|
||||
|
|
Loading…
Reference in a new issue