Skip to content

Commit

Permalink
Fixed small build error
Browse files Browse the repository at this point in the history
  • Loading branch information
D42H5 committed Jan 30, 2025
1 parent 3135fb3 commit 6743c28
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions site/visitor-console/src/pages/EquipmentUsage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,19 @@ const EquipmentUsage = () => {
console.log(JSON.stringify(updatedLog, null, 2));

try {
const user_id = updatedLog.user_id;
delete updatedLog.user_id;

const response = await fetch(`${api_endpoint}/equipment/${user_id}`, {
method: "PATCH",
headers: {
"Content-Type": "application/json",
"X-Api-Key": import.meta.env.VITE_BACKEND_KEY,
},
body: JSON.stringify(updatedLog),
});
const { user_id, ...updatedLogWithoutUserId } = updatedLog;

const response = await fetch(
`${api_endpoint}/equipment/${updatedLog.user_id}`,
{
method: "PATCH",
headers: {
"Content-Type": "application/json",
"X-Api-Key": import.meta.env.VITE_BACKEND_KEY,
},
body: JSON.stringify(updatedLogWithoutUserId),
}
);

if (response.ok) {
const responseData = await response.json();
Expand Down

0 comments on commit 6743c28

Please sign in to comment.