+
{' '}
- {pkg_item.name}
+ {pkg_item.name}
{pkg_item.description}
diff --git a/src/components/login/loginpage.jsx b/src/components/login/loginpage.jsx
index 2776d90..63b55a4 100644
--- a/src/components/login/loginpage.jsx
+++ b/src/components/login/loginpage.jsx
@@ -1,6 +1,6 @@
import React, { Component } from 'react'
import { withRouter } from 'react-router-dom'
-import { PostCredentials } from '../../helpers/api'
+import { postCredentials } from '../../helpers/api'
class LoginPage extends Component {
constructor(props) {
diff --git a/src/components/login/signup.jsx b/src/components/login/signup.jsx
index 0451b0c..1240071 100644
--- a/src/components/login/signup.jsx
+++ b/src/components/login/signup.jsx
@@ -1,6 +1,6 @@
import React, { Component } from 'react'
import { withRouter } from 'react-router-dom'
-import { PostUser } from '../../helpers/api'
+import { postUser } from '../../helpers/api'
class SignUp extends Component {
constructor(props) {
diff --git a/src/components/package/container.jsx b/src/components/package/container.jsx
index f0121d6..f1fbd01 100644
--- a/src/components/package/container.jsx
+++ b/src/components/package/container.jsx
@@ -2,6 +2,8 @@ import React from 'react'
import Loader from '../common/loader'
import Error from '../common/error'
import { getPackageId } from '../../helpers/api'
+import { Link } from 'react-router-dom'
+import { postCredentials } from '../../helpers/api'
class Package extends React.Component {
constructor(props) {
super(props)
@@ -13,9 +15,10 @@ class Package extends React.Component {
}
componentDidMount() {
- const id = this.props.match.params.id
+ const slug = this.props.match.params.slug
+ console.log(slug)
- getPackageId(id)
+ getPackageId(slug)
.then(output => {
this.setState({ pkg: output, isloading: false })
console.log(output)
@@ -35,10 +38,8 @@ class Package extends React.Component {
Name:{pkg.name}
Description:{pkg.description}
- Duration:{pkg.duration}
- {pkg.conditions.map(item => (
- condition:{item}
- ))}
+ {/* booking for user */}
+ Book Now
)
}
diff --git a/src/components/router.jsx b/src/components/router.jsx
index d581e40..8b00d94 100644
--- a/src/components/router.jsx
+++ b/src/components/router.jsx
@@ -5,6 +5,7 @@ import Signup from './login/signup'
import Login from './login/loginpage'
import Package from './package'
import Category from './category'
+import Booking from './booking/book'
class Routing extends React.Component {
render() {
@@ -14,7 +15,8 @@ class Routing extends React.Component {
-
+
+
{/* TODO:
*/}
diff --git a/src/helpers/api.js b/src/helpers/api.js
index 8552a4b..4333ded 100644
--- a/src/helpers/api.js
+++ b/src/helpers/api.js
@@ -1,6 +1,6 @@
import axios from 'axios'
-const BASE_URL = 'https://salty-thicket-13140.herokuapp.com/api/v1'
+const BASE_URL = 'http://127.0.0.1:3000/api/v1/'
export function getAllPackage() {
return fetch(`${BASE_URL}/package/all`).then(res => res.json())
@@ -32,3 +32,11 @@ export function postCredentials(user) {
data: user,
})
}
+
+export function postBookingDetails(bookingDetails) {
+ return axios({
+ method: 'POST',
+ url: `${BASE_URL}/book`,
+ data: bookingDetails,
+ })
+}