Commit 9eba301f authored by Tamás Danis's avatar Tamás Danis

bug fix

parent 0b8b421c
......@@ -6,15 +6,17 @@ use App\Product;
use App\Transaction;
use Carbon\Carbon;
use Exception;
use function foo\func;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
class TransactionController extends Controller {
public function save( Request $request ) {
$date = Carbon::make( $request["date"] );
$date = $date->setTime( Carbon::now()->hour, Carbon::now()->minute, Carbon::now()->second );
DB::beginTransaction();
$payload = [
'created_at' => $request["date"],
'created_at' => $date,
'description' => $request["description"],
'user_id' => $request["userId"]
];
......@@ -26,7 +28,7 @@ class TransactionController extends Controller {
$payload = [
'name' => $product["product"],
'price' => $product["price"],
'created_at' => $request["date"],
'created_at' => $date,
'transaction_id' => $transactionId
];
$product = new Product( $payload );
......
......@@ -62,6 +62,7 @@ class API {
userId: getUserId()
});
const url = `${saveTransactionUrl}${getToken()}`;
console.log(url, payload);
return new Promise(resolve => {
axios.post(url, payload)
.then(response => {
......
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import moment from 'moment';
import ProductsArea from './ProductsArea';
import * as transactionActions from '../../../../../actions/transactionActions';
import moment from 'moment';
const TransactionListItem = ({ transaction, deleteTransaction }) => {
const handleClick = () => deleteTransaction(transaction.id);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment