mirror of
https://github.com/IoTManagerProject/IoTManagerWeb.git
synced 2026-03-26 23:12:34 +03:00
исправлен баг
This commit is contained in:
@@ -104,16 +104,42 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//иногда не отправляет токен - непонятно почему
|
||||||
|
//const placeOrder = async () => {
|
||||||
|
// delete myProfileJson["_id"];
|
||||||
|
// const JWT = Cookies.get("token_iotm2");
|
||||||
|
// try {
|
||||||
|
// let res = await fetch("https://portal.iotmanager.org/compiler/order", {
|
||||||
|
// mode: "cors",
|
||||||
|
// method: "POST",
|
||||||
|
// headers: {
|
||||||
|
// "Content-Type": "application/json",
|
||||||
|
// Authorization: `Bearer ${JWT}`,
|
||||||
|
// },
|
||||||
|
// body: JSON.stringify(myProfileJson),
|
||||||
|
// });
|
||||||
|
// const content = await res.json();
|
||||||
|
// if (res.ok) {
|
||||||
|
// errors = [{ msg: "ok_success" }];
|
||||||
|
// await getUserBuilds();
|
||||||
|
// console.log(content.message);
|
||||||
|
// } else {
|
||||||
|
// errors = content.message;
|
||||||
|
// }
|
||||||
|
// } catch (e) {
|
||||||
|
// console.log(e);
|
||||||
|
// }
|
||||||
|
//};
|
||||||
|
|
||||||
|
//временно используем без jwt
|
||||||
const placeOrder = async () => {
|
const placeOrder = async () => {
|
||||||
delete myProfileJson["_id"];
|
delete myProfileJson["_id"];
|
||||||
const JWT = Cookies.get("token_iotm2");
|
|
||||||
try {
|
try {
|
||||||
let res = await fetch("https://portal.iotmanager.org/compiler/order", {
|
let res = await fetch("https://portal.iotmanager.org/compiler/esporder", {
|
||||||
mode: "cors",
|
mode: "cors",
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
Authorization: `Bearer ${JWT}`,
|
|
||||||
},
|
},
|
||||||
body: JSON.stringify(myProfileJson),
|
body: JSON.stringify(myProfileJson),
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user