refactor(api): extract shared artifact-admin helpers (list query, scope defaults, slugify)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 55/100
- issue の種類
- リファクタリング
- 明瞭さ
- 明確に書かれている
- 活発さ
- 静か
調査の方向性
Start by comparing the duplicated logic in admin/events/index.ts, admin/events/byId.ts, admin/announcements/index.ts, admin/announcements/byId.ts, and eventsSubmit.ts. Extract the three named helpers into shared modules while preserving the per-artifact route structure, then run the existing test suite; done means all listed routes use the helpers and tests pass.
索引モデルが issue の本文から書いたものです。
説明
Summary
The admin routes for events and announcements are 80%+ identical: zod validation schemas, list-query where builder, scope-by-author-class defaulting, pagination shape, audit-row writing on PATCH. Plans 4 (forms) and 5 (broadcast) will add more parallel surfaces; extract before that hardens.
Requirements
- Extract
buildArtifactListWhere(table, query, allowedStatuses, allowedScopes)to a shared module - Extract
inferDefaultScope(actor)helper - Extract
slugify(name)topackages/api/src/lib/slug.ts(currently duplicated inadmin/events/index.tsandeventsSubmit.ts) - Refactor
admin/events/index.ts,admin/events/byId.ts,admin/announcements/index.ts,admin/announcements/byId.ts, andeventsSubmit.tsto use the shared helpers - All existing tests still pass
Context
Flagged in both the Plan 2 and Plan 3 final reviews. Parallel artifact types are intentionally separated at the table level, but the route-construction code wants to be shared.
Implementation Notes
Keep the per-artifact-type sub-app structure (one folder per artifact under routes/admin/) — only the helpers move out. Don't introduce a polymorphic router; that fights Drizzle's type narrowing.
- 主要言語
- HTML
- スター
- 33
- フォーク
- 107
- 平均マージ
- 14時間 6分
- マージ済み PR(30日)
- 19
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
USRSE/usrse.github.io のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
USRSE/usrse.github.io#2117 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 63/100
USRSE/usrse.github.io#2115 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
broken-links
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
USRSE/usrse.github.io#2099 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
USRSE/usrse.github.io#2085 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
USRSE/usrse.github.io#2001 ·
メンテナーはふだん 1 日以内に返信
USRSE/usrse.github.io の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
rubenarslan/formr#63 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
qoretechnologies/qore#8159 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信