Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/routes/customers.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
$db = null;
echo json_encode($customers);
} catch(PDOException $e){
echo '{"error": {"text": '.$e->getMessage().'}';
echo '{"error": {"text": '.$e->getMessage().'} }';
}
});

Expand All @@ -52,7 +52,7 @@
$db = null;
echo json_encode($customer);
} catch(PDOException $e){
echo '{"error": {"text": '.$e->getMessage().'}';
echo '{"error": {"text": '.$e->getMessage().'} }';
}
});

Expand Down Expand Up @@ -87,10 +87,10 @@

$stmt->execute();

echo '{"notice": {"text": "Customer Added"}';
echo '{"notice": {"text": "Customer Added"} }';

} catch(PDOException $e){
echo '{"error": {"text": '.$e->getMessage().'}';
echo '{"error": {"text": '.$e->getMessage().'} }';
}
});

Expand Down Expand Up @@ -133,10 +133,10 @@

$stmt->execute();

echo '{"notice": {"text": "Customer Updated"}';
echo '{"notice": {"text": "Customer Updated"} }';

} catch(PDOException $e){
echo '{"error": {"text": '.$e->getMessage().'}';
echo '{"error": {"text": '.$e->getMessage().'} }';
}
});

Expand All @@ -155,8 +155,8 @@
$stmt = $db->prepare($sql);
$stmt->execute();
$db = null;
echo '{"notice": {"text": "Customer Deleted"}';
echo '{"notice": {"text": "Customer Deleted"} }';
} catch(PDOException $e){
echo '{"error": {"text": '.$e->getMessage().'}';
echo '{"error": {"text": '.$e->getMessage().'} }';
}
});
});