-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parts and robots #46
Parts and robots #46
Conversation
fixing merge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
frontend/src/hooks/rob.tsx
Outdated
const response = await this.api.get(`/robots/${robotId}`); | ||
return response.data; | ||
} catch (error) { | ||
if (axios.isAxiosError(error)) { | ||
console.error("Error fetching robot:", error.response?.data); | ||
throw new Error(error.response?.data?.detail || "Error fetching robot"); | ||
} else { | ||
console.error("Unexpected error:", error); | ||
throw new Error("Unexpected error"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this pattern is repeated 3 times, consider refactoring into a helper function (might need to do some typing voodoo to make work)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i feel like the effort to make it "generic" (there are a lot of subtly different args) would not be worthwhile atm
frontend/src/pages/PartDetails.tsx
Outdated
purchase_links: part.purchase_links, | ||
used_by: part.used_by, | ||
}; | ||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can just delete instead of commenting out
frontend/src/hooks/rob.tsx
Outdated
@@ -0,0 +1,111 @@ | |||
import axios from "axios"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it possible to auto-generate these interfaces from the openapi.json file for the backend?
store/app/api/routers/users.py
Outdated
@@ -12,7 +12,7 @@ | |||
|
|||
from store.app.api.crypto import get_new_api_key, get_new_user_id | |||
from store.app.api.db import Crud | |||
from store.app.api.email import OneTimePassPayload, send_delete_email, send_otp_email | |||
from store.app.api.email_utils import OneTimePassPayload, send_delete_email, send_otp_email |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can instead make a utils
dir and move this to utils/email.py
Yeah there's a lot of accumulated cruft everywhere because this branch diverged from master a while ago. A lot of these things are actually regressions that I think we just failed to spot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
request
TODO: move crud methods into helper crud
31a76c7
to
6330f69
Compare
6330f69
to
35af3ce
Compare
09399e5
to
c35f520
Compare
c35f520
to
5f803d0
Compare
@codekansas ready to merge |
(refactoring stuff inot crud will be next pr) |
glue together frontend and non user api stuff