Skip to content

Commit

Permalink
json stringify submit and added cors headers
Browse files Browse the repository at this point in the history
  • Loading branch information
lauren-mieczkowski committed Jan 12, 2024
1 parent 07c5bdf commit 161477e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/connect/components/DeviceForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const DeviceForm = ({

const findrapi = axios.create({
baseURL: "http://3.95.191.132:30806",
headers: {'Content-Type': 'application/json'}
headers: {'Content-Type': 'application/json', "Access-Control-Allow-Origin": "*"}
});


Expand All @@ -92,9 +92,9 @@ const DeviceForm = ({
console.log("handling submit");
console.log(values);
console.log(JSON.stringify(values));
findrapi.post("/oracle", values)
findrapi.post("/oracle", JSON.stringify(values))
.then(function (res) {
console.log(res)
console.log('res:', res)
if (res.status === 200) {
alert('Successfully registered device!');
}
Expand Down

0 comments on commit 161477e

Please sign in to comment.