fix(public-api): use schema fields order and type in V1BioLinksController
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 85/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- postgresql, typescript
調査の方向性
apps/api/src/public-api/controllers/v1-bio-links.controller.tsを、packages/prisma/schema.prisma内の指定されたモデルとあわせて読みます。Issueに記載された並び順フィールド、分析フィルター、URL検証を更新し、一覧にある/v1/bio-linksエンドポイントまたは既存のテストを実行します。これらのエンドポイントがPrismaのフィールドエラーなしでスキーマに対して実行でき、HTTPまたはHTTPSを使用しないURLを拒否すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Problem Description
In apps/api/src/public-api/controllers/v1-bio-links.controller.ts, multiple /v1/bio-links endpoints query or write non-existent Prisma fields that do not match packages/prisma/schema.prisma, causing runtime Prisma validation errors on every call:
-
positionused instead oforder:getBioPageOrThrow(lines 35-38) passesorderBy: { position: 'asc' }forlinks,products,socialButtons, andfaqs.addLink(lines 104 & 113) readsl.positionand writesposition: maxPos + 1.- In
packages/prisma/schema.prisma,BioProduct,BioSocialButton,BioLink, andBioFaqall useorder(Int @default(0)), notposition.
-
eventTypeused instead oftype:getAnalytics(lines 170 & 173) queriesbioAnalyticsEvent.countwitheventType: 'PAGE_VIEW'andeventType: 'LINK_CLICK'.- In
packages/prisma/schema.prisma,BioAnalyticsEvent(line 1006) usestype(String // "view" or "click"), noteventType.
Expected Behavior
- All
/v1/bio-linksendpoints (GET /v1/bio-links,PATCH /v1/bio-links,GET/POST/DELETE /v1/bio-links/links,GET /v1/bio-links/products,GET /v1/bio-links/leads,GET /v1/bio-links/analytics) execute cleanly against the Prisma schema without runtime field errors. addLinkshould also validatebody.urluses anhttp:orhttps:scheme before saving.
Where to Look
apps/api/src/public-api/controllers/v1-bio-links.controller.ts(lines 31-49, 104-114, 162-189)packages/prisma/schema.prisma(BioProduct,BioSocialButton,BioLink,BioFaq,BioAnalyticsEvent)
Solution / Implementation Guide
- In
getBioPageOrThrow(lines 35-38), replaceorderBy: { position: 'asc' }withorderBy: { order: 'asc' }onlinks,products,socialButtons, andfaqs. - In
addLink(lines 104-114), replacel.positionwithl.orderandposition: maxPos + 1withorder: maxOrder + 1(and validatebody.urlis a validhttp:/https:URL). - In
getAnalytics(lines 170 & 173), replaceeventType: 'PAGE_VIEW'withtype: 'view'andeventType: 'LINK_CLICK'withtype: 'click'.
- 主要言語
- TypeScript
- スター
- 2
- フォーク
- 1
- 平均マージ
- 6分
- マージ済み PR(30日)
- 27
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
sumamakhan761/tryinstance のほかの issue
-
backend good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
sumamakhan761/tryinstance#65 ·
メンテナーはふだん 1 日以内に返信
-
backend good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
sumamakhan761/tryinstance#64 ·
メンテナーはふだん 1 日以内に返信
-
backend good first issue
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
sumamakhan761/tryinstance#63 ·
メンテナーはふだん 1 日以内に返信
-
backend good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
sumamakhan761/tryinstance#62 ·
メンテナーはふだん 1 日以内に返信
-
backend good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
sumamakhan761/tryinstance#60 ·
メンテナーはふだん 1 日以内に返信
sumamakhan761/tryinstance の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
makecindy/cindy#15342 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
kwitsch/claude-code-plugin-tooling#219 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
no-repo-link tool-submission
難易度 1/5 1時間未満 初心者へのやさしさ 74/100
BraveOPotato/NoSignups#2618 ·
-
enhancement good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100