Closed ju-ki closed 1 week ago
新しい CategoryController
、Category
モデル、CategoryService
、および CategoryFactory
が追加され、カテゴリ管理のための API エンドポイントが実装されました。これにより、カテゴリの取得と作成が可能になり、関連するテストも追加されました。フロントエンドでは、カテゴリのリストを表示し、新しいカテゴリを作成するためのコンポーネントが実装されています。
ファイル | 変更概要 |
---|---|
backend/app/Http/Controllers/API/CategoryController.php |
CategoryController クラスを追加し、カテゴリの取得 (index ) と作成 (create ) メソッドを実装。 |
backend/app/Models/Category.php |
Category モデルを追加し、id と name プロパティを定義。 |
backend/app/Services/CategoryService.php |
CategoryService クラスを追加し、全カテゴリ取得 (get_all_categories ) とカテゴリ作成 (create ) メソッドを実装。 |
backend/database/factories/CategoryFactory.php |
CategoryFactory クラスを追加し、カテゴリモデルのインスタンスを生成するための definition メソッドを実装。 |
backend/routes/api.php |
カテゴリ関連の新しいルートを追加。GET /api/categories と POST /api/categories/create を実装。 |
backend/tests/Feature/CategoryTest.php |
カテゴリ API の機能をテストするための CategoryTest クラスを追加。 |
backend/tests/Unit/CategoryTest.php |
Category モデルと CategoryService のユニットテストを追加。 |
frontend/src/components/Common/Layout/Admin/index.tsx |
カテゴリ作成ボタンをカテゴリ一覧リンクに置き換え。 |
frontend/src/hooks/api/category/index.ts |
カテゴリ管理用の API 関数 fetchAllCategories と createCategory を追加。 |
frontend/src/pages/admin/category/index.tsx |
CategoryList コンポーネントを追加し、カテゴリの取得と作成を実装。 |
frontend/src/types/category.ts |
CategoryType 型を追加し、カテゴリの構造を定義。 |
PostController
クラスに create
メソッドが追加され、カテゴリコントローラの create
メソッドと類似。PostController
の create
メソッドがユーザー識別のために Auth::id()
を使用するように変更され、カテゴリコントローラのユーザー管理に関連。PostController
に updatePost
メソッドが追加され、カテゴリコントローラの CRUD 操作と類似の構造を示す。🐇 うさぎの歌
カテゴリが増えたよ、嬉しいな!
新しい道が開けた、みんなで行こう!
データが集まる、楽しい時間、
みんなの声が響く、ハッピーな瞬間!
さあ、跳ねよう、未来へ向かって! 🌼
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
@coderabbitai review
This PR is automatically created by GitHub Actions
Summary by CodeRabbit
新機能
バグ修正
テスト