Skip to content

Commit

Permalink
fix: await Promise when seeding (#9245)
Browse files Browse the repository at this point in the history
Currently this Promise is unhandled, meaning if it errors it won't get
caught by the `try/catch`
  • Loading branch information
G-Rath authored Oct 3, 2023
1 parent 49d41f6 commit e759b34
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion __fixtures__/empty-project/scripts/seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default async () => {

// Note: if using PostgreSQL, using `createMany` to insert multiple records is much faster
// @see: https://www.prisma.io/docs/reference/api-reference/prisma-client-reference#createmany
Promise.all(
await Promise.all(
//
// Change to match your data model and seeding needs
//
Expand Down
2 changes: 1 addition & 1 deletion __fixtures__/test-project/scripts/seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export default async () => {

// Note: if using PostgreSQL, using `createMany` to insert multiple records is much faster
// @see: https://www.prisma.io/docs/reference/api-reference/prisma-client-reference#createmany
Promise.all(
await Promise.all(
//
// Change to match your data model and seeding needs
//
Expand Down
2 changes: 1 addition & 1 deletion packages/create-redwood-app/templates/js/scripts/seed.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default async () => {

// Note: if using PostgreSQL, using `createMany` to insert multiple records is much faster
// @see: https://www.prisma.io/docs/reference/api-reference/prisma-client-reference#createmany
Promise.all(
await Promise.all(
//
// Change to match your data model and seeding needs
//
Expand Down
2 changes: 1 addition & 1 deletion packages/create-redwood-app/templates/ts/scripts/seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default async () => {

// Note: if using PostgreSQL, using `createMany` to insert multiple records is much faster
// @see: https://www.prisma.io/docs/reference/api-reference/prisma-client-reference#createmany
Promise.all(
await Promise.all(
//
// Change to match your data model and seeding needs
//
Expand Down

0 comments on commit e759b34

Please sign in to comment.