Skip to content

Commit

Permalink
200 error
Browse files Browse the repository at this point in the history
  • Loading branch information
lauren-mieczkowski committed Jan 11, 2024
1 parent 6ae554a commit 764c937
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/connect/components/DeviceForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,12 @@ const DeviceForm = ({
findrapi.post("/oracle", values)
.then(function (res) {
console.log(res)
alert('Successfully registered device!');
if (res.status === 200) {
alert('Successfully registered device!');
}
})
.catch(function (error) {
alert('Error!')
console.log(JSON.stringify(error));
if (error.response) {
// The request was made and the server responded with a status code
Expand Down Expand Up @@ -135,9 +138,12 @@ const DeviceForm = ({

// Log the response and notify the user
console.log(res);
alert('Successfully registered device!');
if (res.status === 200) {
alert('Successfully registered device!');
}
} catch (error) {
// Handle errors
alert('Error!');
console.log(JSON.stringify(error));

if (axios.isAxiosError(error)) {
Expand Down

0 comments on commit 764c937

Please sign in to comment.