← メール履歴一覧

Re: [CSplus/RelationshipCRM] 基盤構築(Next.js + Prisma 7 + Neon PostgreSQL)と連絡先CRUD (PR #1)

受信Gmail同期2026/07/11 15:20
編集

未紐付けのメールです

連絡先を選択して紐付けると、連絡先・会社のメール履歴に表示されます

相手(連絡先)
-
会社
-
From(Gmail)
notifications@github.com
To / Cc(Gmail)
relationshipcrm@noreply.github.com, koshiba@csplus.jp, author@noreply.github.com
作成日時
2026/07/12 11:08
更新日時
2026/07/12 11:08

本文

@chatgpt-codex-connector[bot] commented on this pull request. ### 💡 Codex Review Here are some automated review suggestions for this pull request. **Reviewed commit:** `a9e4464460` <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". </details> > +} + +// ============ ユーザー(将来の認証用。当面は単一ユーザー運用)============ +model User { + id String @id @default(cuid()) + name String + email String @unique + interactions Interaction[] + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt +} + +// ============ 会社 ============ +model Company { + id String @id @default(cuid()) + name String **<sub><sub>![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat)</sub></sub> Enforce unique company names for find-or-create** When two contact creates for the same new company name run concurrently, both calls to `resolveCompanyId` can observe no existing row and insert separate `Company` records because `name` is only indexed, not unique. That splits contacts across duplicate companies even though the flow is documented as find-or-create by name; make the name constraint unique and use an upsert/transaction so the race cannot create duplicates. Useful? React with 👍 / 👎. > + q?: string; + rank?: string; + page?: string; +}>; + +export default async function ContactsPage({ + searchParams, +}: { + searchParams: SearchParams; +}) { + const params = await searchParams; + const rank = relationshipRankValues.find((r) => r === params.rank); + const page = Number(params.page) || 1; + + const result = await contactSearch.search({ + keyword: params.q, **<sub><sub>![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat)</sub></sub> Normalize repeated contact search params** In Next page props, a repeated query key is delivered as `string[]`, so a URL like `/contacts?q=alice&q=bob` passes an array here into `contactSearch`; the Prisma implementation then calls `query.keyword?.trim()` and throws, making the contacts page return an error. Coerce `q`, `rank`, and `page` to a single string or reject arrays before using them. Useful? React with 👍 / 👎. -- Reply to this email directly or view it on GitHub: https://github.com/CSplus/RelationshipCRM/pull/1#pullrequestreview-4676793993 You are receiving this because you authored the thread. Message ID: <CSplus/RelationshipCRM/pull/1/review/4676793993@github.com>