Merged
Conversation
Contributor
There was a problem hiding this comment.
Copilot reviewed 3 out of 5 changed files in this pull request and generated 1 comment.
Files not reviewed (2)
- package.json: Language not supported
- prisma/seed/GFM.txt: Language not supported
Comments suppressed due to low confidence (1)
prisma/seed/init.ts:225
- [nitpick] Consider using a more user-friendly identifier such as a username or slug in the mention message instead of the raw user ID for improved readability.
content: `Hello @${adminUser.id}, please review the latest update.`
|
|
||
| // 様々なパターンが入ったメッセージ | ||
| const filePath = path.join(__dirname, "GFM.txt"); | ||
| const content = fs.readFileSync(filePath, "utf8"); |
There was a problem hiding this comment.
Consider adding error handling around the file read operation to gracefully manage cases where 'GFM.txt' might be missing or inaccessible.
Suggested change
| const content = fs.readFileSync(filePath, "utf8"); | |
| let content = ""; | |
| try { | |
| content = fs.readFileSync(filePath, "utf8"); | |
| } catch (err) { | |
| console.error(`Error reading file ${filePath}:`, err); | |
| } |
saka-naname
approved these changes
Apr 5, 2025
prisma/seed/init.ts
Outdated
| // ワークスペース作成 | ||
| const workspace = await prisma.workspace.create({ | ||
| data: { | ||
| name: "Digichart for Insider", |
Contributor
|
|
||
| // 様々なパターンが入ったメッセージ | ||
| const filePath = path.join(__dirname, "GFM.txt"); | ||
| const content = fs.readFileSync(filePath, "utf8"); |
Contributor
There was a problem hiding this comment.
Copilotによってファイルの読み込み失敗時の処理について指摘がされていますが、今回のケースにおいてはGFM.txtが存在しない時abortしてしまった方が
Markdownの表示確認がうまくできなかった際に「ファイルが読み込めていなかった」という可能性を潰すことができるので、個人的にはこのままで構わないと思います。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

close #41
Prismaのseedコマンドにリセット処理を追加し、シードデータの種類を増やしました。