Fix undefined $wish_id

This commit is contained in:
grandeljay 2022-06-14 13:31:24 +02:00
parent c0ed1bc21a
commit ca8d40d65d

View file

@ -140,10 +140,10 @@ switch ($_SERVER['REQUEST_METHOD']) {
/**
* Product
*/
if (!empty($_POST['wish_price'])) {
$wish_id = $database->lastInsertId();
$wish_price = $_POST['wish_price'];
$wish_id = $database->lastInsertId();
$wish_price = floatval($_POST['wish_price']);
if ($wish_price > 0) {
$database
->query(
'INSERT INTO `products`
@ -156,9 +156,9 @@ switch ($_SERVER['REQUEST_METHOD']) {
);'
);
}
}
$response['lastInsertId'] = $wish_id;
$response['lastInsertId'] = $wish_id;
}
}
break;