Fixed backend URL | Some features

This commit is contained in:
2020-10-24 19:25:36 +02:00
parent f5f758dbdc
commit 8325759c2f
13 changed files with 95 additions and 36 deletions

View File

@@ -205,7 +205,7 @@ export default function EditDish() {
};
dispatch(showBackdrop());
axios({
url: backend + "/dish",
url: backend + "dish",
method: "PUT",
data: data,
headers: {

View File

@@ -196,7 +196,7 @@ export default function NewRestaurant() {
};
dispatch(showBackdrop());
axios({
url: backend + "/dish",
url: backend + "dish",
method: "POST",
data: data,
headers: {

View File

@@ -187,7 +187,7 @@ export default function NewRestaurant() {
};
dispatch(showBackdrop());
axios({
url: backend + "/restaurant",
url: backend + "restaurant",
method: "POST",
data: data,
headers: {

View File

@@ -214,7 +214,7 @@ export default function EditRestaurantInfo(props) {
};
dispatch(showBackdrop());
axios({
url: backend + "/restaurant",
url: backend + "restaurant",
method: "PUT",
data: data,
headers: {

View File

@@ -53,7 +53,7 @@ export default function EditRestaurantLocation(props) {
hidden: hidden,
};
axios({
url: backend + "/restaurant",
url: backend + "restaurant",
method: "PUT",
data: data,
headers: {

View File

@@ -59,7 +59,7 @@ export default function EditRestaurantMenu(props) {
action: "add",
};
axios({
url: backend + "/restaurant/category",
url: backend + "restaurant/category",
method: "POST",
data: data,
headers: {
@@ -86,7 +86,7 @@ export default function EditRestaurantMenu(props) {
action: "delete",
};
axios({
url: "http://localhost:4000/restaurant/category",
url: backend + "restaurant/category",
method: "POST",
data: data,
headers: {

View File

@@ -50,7 +50,7 @@ export default function EditRestaurantPhoto(props) {
hidden: hidden,
};
axios({
url: backend + "/restaurant",
url: backend + "restaurant",
method: "PUT",
data: data,
headers: {

View File

@@ -8,6 +8,7 @@ import { backend } from "../../config.js";
import { showBackdrop, hideBackdrop } from "../../actions/toggles";
import PaymentDialog from "../Dialogs/PaymentDialog";
import { openInNewTab, formatDateBasic } from "../../Services.js";
import LocalOfferIcon from '@material-ui/icons/LocalOffer';
export default function EditRestaurantSubscription(props) {
const { subscriptionActive, subscriptionDue } = props.restaurant;
@@ -37,7 +38,7 @@ export default function EditRestaurantSubscription(props) {
dispatch(showBackdrop());
axios({
method: "POST",
url: backend + "/restaurant/subscription",
url: backend + "restaurant/subscription",
data: data,
headers: {
"x-auth-token": token,
@@ -78,38 +79,62 @@ export default function EditRestaurantSubscription(props) {
)}
</div>
{!subscriptionActive && (
<div>
<div className="subscription-content">
<p>
Aktywuj subskrypcję, aby Twoja restauracja była widoczna. Na tydzień
przed końcem subskrypcji wyślemy Ci email z możliwością opłacenia
subskrypcji na kolejny okres.
</p>
<div className="subscription-cards">
<div className="subscription-card">
<h1>1 rok</h1>
<div className="subscription-title">
<LocalOfferIcon/>
<h1>Za darmo</h1>
</div>
<Divider style={{ width: "100%" }} />
<h2>
<strike>600</strike> 500zł (netto)
</h2>
<p>Aktywuj subskrypcję na 12 miesięcy i zapłać mniej.</p>
<h2>3 miesiące</h2>
<div className="subscription-desc">
<p>Możesz jednorazowo aktywować darmowe 3 miesiące subskrypcji, by móc spokojnie uzupełnić menu.</p>
</div>
<Divider style={{ width: "100%" }} />
<ButtonSecondary
text="Aktywuj"
onClick={() => handleActivateSubscription(12)}
onClick={() => handleActivateSubscription(3)}
/>
</div>
<div className="subscription-card">
<h1>1 miesiąc</h1>
<div className="subscription-title">
<LocalOfferIcon/>
<h1>50</h1>
</div>
<Divider style={{ width: "100%" }} />
<h2>50 (netto)</h2>
<p>Aktywuj subskrypcję na jeden miesiąc.</p>
<h2>1 miesiąc</h2>
<div className="subscription-desc">
<p>Aktywuj subskrypcję na jeden miesiąc.</p>
</div>
<Divider style={{ width: "100%" }} />
<ButtonSecondary
text="Aktywuj"
onClick={() => handleActivateSubscription(1)}
/>
</div>
<div className="subscription-card">
<div className="subscription-title">
<LocalOfferIcon/>
<h1>500</h1>
</div>
<Divider style={{ width: "100%" }} />
<h2>1 rok</h2>
<div className="subscription-desc">
<p>Zapłać z góry za cały rok, a otrzymasz dwa miesiące w prezencie.</p>
</div>
<Divider style={{ width: "100%" }} />
<ButtonSecondary
text="Aktywuj"
onClick={() => handleActivateSubscription(12)}
/>
</div>
</div>
<p>
Aktywuj subskrypcję, aby Twoja restauracja była widoczna. Na tydzień
przed końcem subskrypcji wyślemy Ci email z możliwością opłacenia
subskrypcji na kolejny okres.
</p>
</div>
)}
{subscriptionActive && (

View File

@@ -150,7 +150,7 @@ export default function EditCategoriesList(props) {
dispatch(showBackdrop());
axios({
method: "POST",
url: backend + "/restaurant/lunchSet",
url: backend + "restaurant/lunchSet",
data: data,
headers: {
"x-auth-token": token,

View File

@@ -14,7 +14,7 @@ export default function ImageUpload(props) {
data.append("menuiImage", event.target.files[0]);
setLoading(true);
axios({
url: backend + "/img",
url: backend + "img",
method: "POST",
data: data,
headers: {

View File

@@ -14,7 +14,7 @@ export default function ImageUpload(props) {
data.append("menuiImage", event.target.files[0]);
setLoading(true);
axios({
url: backend + "/img",
url: backend + "img",
method: "POST",
data: data,
headers: {