fixed saving and modifying parts
This commit is contained in:
@@ -37,7 +37,7 @@ if ($partDescription) {
|
||||
':part_description' => $partDescription,
|
||||
':mix' => $mix
|
||||
]);
|
||||
echo json_encode(['success' => true, 'message' => 'Parte aggiornata con successo']);
|
||||
echo json_encode(['success' => true, 'part_id' => $partId, 'part_number'=>$partNumber, 'message' => 'Parte aggiornata con successo']);
|
||||
} else {
|
||||
// INSERT თუ ახალია
|
||||
$stmt = $pdo->prepare("INSERT INTO identification_parts
|
||||
@@ -50,7 +50,7 @@ if ($partDescription) {
|
||||
':mix' => $mix
|
||||
]);
|
||||
$newId = $pdo->lastInsertId();
|
||||
echo json_encode(['success' => true, 'message' => 'Parte salvata con successo', 'part_id' => $newId]);
|
||||
echo json_encode(['success' => true, 'part_id' => $newId, 'part_number'=>$partNumber, 'message' => 'Parte salvata con successo']);
|
||||
}
|
||||
} catch (PDOException $e) {
|
||||
echo json_encode(['success' => false, 'message' => 'Errore nel salvataggio: ' . $e->getMessage()]);
|
||||
|
||||
Reference in New Issue
Block a user