-
Notifications
You must be signed in to change notification settings - Fork 75
Google拡張クライアント用のAPIエンドポイントを作成 #9287
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
base: feature/redesign-buzzes-page
Are you sure you want to change the base?
Google拡張クライアント用のAPIエンドポイントを作成 #9287
Conversation
全件だと一部整形作業が必要なため
title, url, memo, published_atカラムを追加 fixturesのpublished_on -> published_atに変更
indexアクションの中身を追加。LPの紹介・言及記事ページに渡すインスタンス変数をセット。
get "buzzes/years/:year", to: "buzzes#index"...
coderadditaiの指摘
coderabbitaiの指摘でkaminariのpagenation前にorderメソッドを挿入
Mentor::BuzzesController#edit/update/delete作成 metnor/buzzes/_form.html.slimのurlフィールドをeditページに非表示 mentor/buzzes/edid.html.slimに削除ボタンを追加
いずれもmentor_buzzes_pathへ修正
title, url, published_atカラムにそれぞれ追加
他: 値取得失敗時に422返却・errorオブジェクトにメッセージを追加
RESTfulな構成にするためにコントローラーを分割しcheckアクションを移設・修正
18afc91 to
7511d5c
Compare
| User.find(doorkeeper_token.resource_owner_id) if doorkeeper_token | ||
| end | ||
|
|
||
| def require_admin_or_mentor_login_for_api |
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.
こちらに書くほうがよいとおもいます。
| module Authentication |
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.
concernsに移動しました。
- destroyアクションのリソースをurlでクエリーするため - destroyアクションのelse句の構文エラーを修正し、正しく404が返却されるようにした
| @@ -0,0 +1,17 @@ | |||
| # frozen_string_literal: true | |||
|
|
|||
| class API::Buzzes::LookupsController < API::BaseController | |||
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.
クラス名(リソース名)は名詞である必要があります。(メソッドが動詞)
bc37e35 to
0ede869
Compare
94fa768 to
791f465
Compare
b36e7d5 to
d3e8f53
Compare
Issue
#9253
概要
作業フェーズ
👉Phase1: Google拡張クライアント用のAPIエンドポイントを作成 #9287
Phase2: BuzzのGoogleExtensionのUIを作成 #1
Phase3: GoogleExtensionとAPI連携
関連Issue
Buzzページのリニューアル#9102
動作確認準備
foreman start -f Procfile.devでサーバーを起動Application > cookieからbootcampのcookieをコピーして控える動作確認
1~5のcurlコマンドをターミナルで実行し、それぞれのレスポンスに、指定の情報が含まれていることを確認してください。
必要に応じて最初にBuzzを削除:
1. showアクションのテスト1(既存レコードがない場合)
レスポンス
2. createアクションのテスト1(新規登録)
レスポンス
201 created
3. showアクションのテスト2(既存レコードがある場合)
レスポンス
{"exists":true,"buzz":{"id":1073191923,"created_at":"2025-11-02T14:47:02.079+09:00","updated_at":"2025-11-02T14:47:02.079+09:00","url":"https://docs.komagata.org/6319","title":"buzz_api登録テスト","published_at":"2025-10-26","memo":null}}%4. createアクションのテスト2(更新)
レスポンス
5. destroyアクションのテスト
レスポンス
200OK
Summary by CodeRabbit
リリースノート
新機能
変更