Skip to content

Commit

Permalink
fix: default to empty string if can't find the necessary relation letter
Browse files Browse the repository at this point in the history
  • Loading branch information
Ovyerus committed Jul 26, 2024
1 parent 9924e3c commit be302d0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion util/prismaToFlow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ const getModelRelations = ({
if (curr.type === "m-n")
for (const [i, field] of curr.fields.entries()) {
const newName = virtualTableName(curr.name, field.tableName);
const virtualLetter = letters[i]!;
// There's probably a better way around this
const virtualLetter = letters[i] || "";

acc[newName] = {
name: newName,
Expand Down

0 comments on commit be302d0

Please sign in to comment.