-
Notifications
You must be signed in to change notification settings - Fork 0
feat: added settings dialog and user settings page #17
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -8,7 +8,12 @@ import { | |||||||||||||||||||||||||
| unauthorizedSchema, | ||||||||||||||||||||||||||
| } from "@/lib/helpers/openapi/schemas" | ||||||||||||||||||||||||||
| import { sessionAuthMiddleware } from "@/middleware/session-auth" | ||||||||||||||||||||||||||
| import { presignRequestSchema, presignResponseSchema } from "./schema" | ||||||||||||||||||||||||||
| import { | ||||||||||||||||||||||||||
| avatarPresignRequestSchema, | ||||||||||||||||||||||||||
| avatarPresignResponseSchema, | ||||||||||||||||||||||||||
| presignRequestSchema, | ||||||||||||||||||||||||||
| presignResponseSchema, | ||||||||||||||||||||||||||
| } from "./schema" | ||||||||||||||||||||||||||
|
Comment on lines
+11
to
+16
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion | 🟠 Major Use This new relative import block introduces an exception inside Suggested change import {
avatarPresignRequestSchema,
avatarPresignResponseSchema,
presignRequestSchema,
presignResponseSchema,
-} from "./schema"
+} from "@/routes/v1/uploads/schema"As per coding guidelines, "Use 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| export const presign = createRoute({ | ||||||||||||||||||||||||||
| path: "/uploads/presign", | ||||||||||||||||||||||||||
|
|
@@ -37,3 +42,30 @@ export const presign = createRoute({ | |||||||||||||||||||||||||
| }) | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| export type PresignRoute = typeof presign | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| export const avatarPresign = createRoute({ | ||||||||||||||||||||||||||
| path: "/uploads/avatar/presign", | ||||||||||||||||||||||||||
| method: "post", | ||||||||||||||||||||||||||
| summary: "Request a presigned URL for avatar upload", | ||||||||||||||||||||||||||
| description: | ||||||||||||||||||||||||||
| "Returns a presigned URL for uploading a user avatar to S3-compatible storage.", | ||||||||||||||||||||||||||
| tags: ["Uploads"], | ||||||||||||||||||||||||||
| middleware: [sessionAuthMiddleware] as const, | ||||||||||||||||||||||||||
| request: { | ||||||||||||||||||||||||||
| body: jsonContent({ | ||||||||||||||||||||||||||
| schema: avatarPresignRequestSchema, | ||||||||||||||||||||||||||
| description: "Avatar file metadata", | ||||||||||||||||||||||||||
| }), | ||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||
| responses: { | ||||||||||||||||||||||||||
| [HttpStatusCodes.OK]: jsonContent({ | ||||||||||||||||||||||||||
| schema: avatarPresignResponseSchema, | ||||||||||||||||||||||||||
| description: "Presigned URL for avatar upload", | ||||||||||||||||||||||||||
| }), | ||||||||||||||||||||||||||
| [HttpStatusCodes.UNAUTHORIZED]: unauthorizedSchema, | ||||||||||||||||||||||||||
| [HttpStatusCodes.REQUEST_TOO_LONG]: payloadTooLargeSchema, | ||||||||||||||||||||||||||
| [HttpStatusCodes.INTERNAL_SERVER_ERROR]: internalServerErrorSchema, | ||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||
| }) | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| export type AvatarPresignRoute = typeof avatarPresign | ||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.
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.
🛠️ Refactor suggestion | 🟠 Major
Switch these local imports to
@/aliases.These new relative specifiers add another inconsistency inside
apps/api/src. Keep them on the alias path so the source tree follows the sametsc-aliasrewrite contract everywhere.Suggested change
As per coding guidelines, "Use
@/*path aliases for imports in compiled packages likeapps/api, withtsc-aliasrewriting them to relative.jspaths in the dist directory`."🤖 Prompt for AI Agents
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.
why is this flagged as major?
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.
@BuckyMcYolo, fair pushback — "Major" was too aggressive here. This is really a Minor style/consistency issue. Same-directory relative imports (./routes,./schema) resolve correctly at build time without any help fromtsc-alias, so there's no functional or runtime risk. The flag is purely about keeping the file internally consistent — the rest ofhandlers.tsalready uses@/aliases for all other imports, and these two new ones break that pattern.In short: it won't cause a bug, it's just an inconsistency. I'll keep that in mind for future severity calibration.
🧠 Learnings used