diff --git a/TourCalcWebApp/App/containers/appstate.jsx b/TourCalcWebApp/App/containers/appstate.jsx
index 7fbd2047..352bfebd 100644
--- a/TourCalcWebApp/App/containers/appstate.jsx
+++ b/TourCalcWebApp/App/containers/appstate.jsx
@@ -214,7 +214,24 @@ export default class AppState {
})
.then(res => res.text())
.then((res) => res, (error) => { alert('Error add tour') })
- }
+ }
+ static addTourJson(comp, tour, accessCode, tname) {
+ if (tname != null) {
+ tour.name = tname
+ }
+ let b = JSON.stringify(tour, null, 2)
+ //alert('b: ' + b)
+ return fetch('/api/tour/add/' + accessCode, {
+ method: 'post',
+ headers: new Headers({
+ "Authorization": 'Bearer ' + this.token,
+ "Content-Type": "application/json"
+ }),
+ body: b
+ })
+ .then(res => res.text())
+ .then((res) => res, (error) => { alert('Error add tour') })
+ }
static changeTourName(comp, tourid, tname) {
let b = JSON.stringify({ name: tname }, null, 2)
//alert('b: ' + b)
diff --git a/TourCalcWebApp/App/containers/tour-list.jsx b/TourCalcWebApp/App/containers/tour-list.jsx
index de341b68..0ee8717a 100644
--- a/TourCalcWebApp/App/containers/tour-list.jsx
+++ b/TourCalcWebApp/App/containers/tour-list.jsx
@@ -52,6 +52,8 @@ export default class TourList extends React.Component {
:
)
}
+ #
+
@@ -77,6 +79,28 @@ export default class TourList extends React.Component {
+
+
+
+ {this.props.authData.type === 'Master' ?
+ Access code:
+ :
+ }
+ New tour name:
+
)
})