Add options for the cards #93

Merged
sb10q merged 42 commits from esavkin/web2019:85-variants into master 2023-11-28 15:32:34 +08:00
3 changed files with 13 additions and 7 deletions
Showing only changes of commit b7087711aa - Show all commits

View File

@ -16,7 +16,6 @@
"@babel/core": "^7.23.2", "@babel/core": "^7.23.2",
"@babel/preset-env": "^7.23.2", "@babel/preset-env": "^7.23.2",
"@babel/preset-react": "^7.22.15", "@babel/preset-react": "^7.22.15",
"axios": "^1.6.0",
"babel-loader": "^9.1.3", "babel-loader": "^9.1.3",
"babel-preset-minify": "^0.5.2", "babel-preset-minify": "^0.5.2",
"bootstrap": "^5.3.0", "bootstrap": "^5.3.0",

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,6 @@
'use strict'; 'use strict';
import React from "react"; import React from "react";
import axios from "axios";
import { createRoot } from "react-dom/client"; import { createRoot } from "react-dom/client";
import PropTypes from "prop-types"; import PropTypes from "prop-types";
import { DragDropContext, Droppable, Draggable } from "react-beautiful-dnd"; import { DragDropContext, Droppable, Draggable } from "react-beautiful-dnd";
@ -1910,11 +1909,18 @@ class Shop extends React.PureComponent {
this.setState({isProcessing: true}); this.setState({isProcessing: true});
axios.post(data.API_RFQ, { fetch(data.API_RFQ, {
method: "POST",
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
email, email,
note, note,
configuration: JSON.stringify(crate) configuration: JSON.stringify(crate)
})
}).then(response => { }).then(response => {
if (response.status !== 200) {
throw Error("Response status is not OK: " + response.status + ".\n" + response);
}
this.setState({ this.setState({
isProcessing: false, isProcessing: false,
shouldShowRFQFeedback: true, shouldShowRFQFeedback: true,
@ -1922,6 +1928,7 @@ class Shop extends React.PureComponent {
isProcessingComplete: true, isProcessingComplete: true,
}); });
}).catch(err => { }).catch(err => {
console.error("Request failed, reason:", err)
this.setState({isProcessing: false}, () => { this.setState({isProcessing: false}, () => {
alert("We cannot receive your request. Try using the export by coping the configuration and send it to us at sales[at]m-labs.hk"); alert("We cannot receive your request. Try using the export by coping the configuration and send it to us at sales[at]m-labs.hk");
}); });