Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! このプルリクエストは、購入報告システムにおける立替者の管理を強化し、ユーザーエクスペリエンスを向上させることを目的としています。具体的には、立替者をユーザーIDで追跡するように変更し、新規報告作成時にはログインユーザーを自動的に設定し、このフィールドを読み取り専用にすることで、データの正確性を高めています。また、購入報告一覧画面での表示もこの新しいユーザーIDベースのロジックに対応しています。 Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
Deploying finansu with
|
| Latest commit: |
3130cc3
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://5a06b87d.finansu.pages.dev |
| Branch Preview URL: | https://feat-chikuwa-buy-report-paid-b6ba.finansu.pages.dev |
| setPurchaseReport((prev) => ({ | ||
| ...prev, | ||
| paidBy: userName, | ||
| paidByUserId: userId || undefined, |
There was a problem hiding this comment.
[ask]
undefinedを許容しているけど、undefinedになることってあるんだっけ?
paidByUserIdって必須になってるんじゃないんだっけ?
There was a problem hiding this comment.
その認識であってます!
paidByだけで登録することとか考えちゃってたかも。
今後はpaidByUserId必須で登録するから修正する
| useEffect(() => { | ||
| let isMounted = true; | ||
|
|
||
| const fetchUsers = async () => { | ||
| try { | ||
| const usersResponse = await get(`${process.env.CSR_API_URI}/users`); | ||
| const users = Array.isArray(usersResponse) | ||
| ? usersResponse | ||
| : Array.isArray(usersResponse?.data) | ||
| ? usersResponse.data | ||
| : []; | ||
|
|
||
| if (!isMounted) return; | ||
|
|
||
| const nameMap = Object.fromEntries( | ||
| (users as User[]).map((targetUser) => [targetUser.id, targetUser.name]), | ||
| ); | ||
| setUserNameMap(nameMap); | ||
| } catch (error) { | ||
| console.error('Failed to fetch users:', error); | ||
| } | ||
| }; | ||
|
|
||
| fetchUsers(); | ||
|
|
||
| return () => { | ||
| isMounted = false; | ||
| }; | ||
| }, []); | ||
|
|
There was a problem hiding this comment.
これisMounted機能してないと思う~
| useEffect(() => { | |
| let isMounted = true; | |
| const fetchUsers = async () => { | |
| try { | |
| const usersResponse = await get(`${process.env.CSR_API_URI}/users`); | |
| const users = Array.isArray(usersResponse) | |
| ? usersResponse | |
| : Array.isArray(usersResponse?.data) | |
| ? usersResponse.data | |
| : []; | |
| if (!isMounted) return; | |
| const nameMap = Object.fromEntries( | |
| (users as User[]).map((targetUser) => [targetUser.id, targetUser.name]), | |
| ); | |
| setUserNameMap(nameMap); | |
| } catch (error) { | |
| console.error('Failed to fetch users:', error); | |
| } | |
| }; | |
| fetchUsers(); | |
| return () => { | |
| isMounted = false; | |
| }; | |
| }, []); | |
| useEffect(() => { | |
| const fetchUsers = async () => { | |
| try { | |
| const usersResponse = await get(`${process.env.CSR_API_URI}/users`); | |
| const users = Array.isArray(usersResponse) | |
| ? usersResponse | |
| : Array.isArray(usersResponse?.data) | |
| ? usersResponse.data | |
| : []; | |
| const nameMap = Object.fromEntries( | |
| (users as User[]).map((targetUser) => [targetUser.id, targetUser.name]), | |
| ); | |
| setUserNameMap(nameMap); | |
| } catch (error) { | |
| console.error('Failed to fetch users:', error); | |
| } | |
| }; | |
| fetchUsers(); | |
| }, []); | |
There was a problem hiding this comment.
あ、違うわ。
これそもそもいらなくない?
buyReports にデータ保存されてると思うけどこのマウント処理ってなんで追加したの?
おそらくだけど、useCurrentUserにuserIdとuserNameが保存されているはずだからこのidをbuyReportsに入れてあげるでいいかも!
There was a problem hiding this comment.
isMounted消します!
buyReportsに保存してるpaidByは購入報告時の名前(過去のデータと合わせるために残ってるだけ)で、今後はPaidByUserIdで管理していくからuserIdからユーザー名を引いてる。
useCurrentUserはログインしてるユーザーのデータだけだからここでは使わないと思う!
…eport-paid-by-user-id-frontend # Conflicts: # view/next-project/src/components/budget_managements/BudgetManagement.tsx # view/next-project/src/components/budget_managements/DeleteBudgetManagementModal.tsx # view/next-project/src/components/common/Header/Header.tsx # view/next-project/src/components/common/RegistModal.tsx # view/next-project/src/components/common/SideNav.tsx # view/next-project/src/components/layout/LoginLayout.tsx # view/next-project/src/components/layout/MainLayout/MainLayout.tsx # view/next-project/src/components/purchasereports/EditModal.tsx # view/next-project/src/components/purchasereports/PurchaseOrderListModal.tsx # view/next-project/src/components/purchasereports/PurchaseReportConfirmModal.tsx # view/next-project/src/components/purchasereports/ReceiptModal.tsx # view/next-project/src/components/purchasereports/UploadFileModal.tsx # view/next-project/src/components/sponsoractivities/AddBlankInvoiceModal.tsx # view/next-project/src/components/sponsoractivities/AddBlankReceiptModal.tsx # view/next-project/src/components/sponsoractivities/FilterModal.tsx # view/next-project/src/components/sponsoractivities/SponsorActivitiesAddModal.tsx # view/next-project/src/components/sponsoractivities/UploadFileModal.tsx # view/next-project/src/generated/hooks.ts # view/next-project/src/pages/404.tsx # view/next-project/src/pages/500.tsx # view/next-project/src/pages/create_purchase_report/index.tsx # view/next-project/src/pages/reset_password/[id]/index.tsx # view/next-project/src/pages/sponsoractivities/index.tsx # view/next-project/src/pages/sponsorstyles/index.tsx # view/next-project/src/pages/users/index.tsx # view/next-project/src/pages/yearperiods/index.tsx
hikahana
left a comment
There was a problem hiding this comment.
一つだけ質問載せてるけど動いてるならよさげ〜
| ds := dialect. | ||
| From("users"). | ||
| Select("users.*"). | ||
| Where(goqu.I("users.id").In(ids)) |
There was a problem hiding this comment.
order by descのは口頭でいらないってなった感じ?
There was a problem hiding this comment.
何も話してない!
けどソートする必要現時点でないなと思ったからやめた!
対応Issue
https://nut-m-e-g.slack.com/archives/C020WQ3GY07/p1766662579010449
概要
画面スクリーンショット等
テスト項目
備考
http://localhost:3000/yearperiodsにアクセスして2026を作成、予算管理ページで新たに部門、物品を作成、userへの部門割り当てを行わないとMy Pageから購入報告できないと思います2026/03/19追記
2026/03/21追記