Skip to content

Commit fcdb872

Browse files
committed
add if when the database has types
1 parent c76d2ec commit fcdb872

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/utils/exportAs/documentation.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ export function jsonToDocumentation(obj) {
5454
return `- **${startTable} to ${endTable}**: ${r.cardinality}\n`;
5555
}).join("") : "";
5656

57-
const documentationTypes = obj.types.map((type) => {
57+
const documentationTypes = databases[obj.database].hasTypes && obj.types.length > 0 ? obj.types.map((type) => {
5858
return `| Name | fields | Note |\n` +
5959
`|-------------|---------------|--------------------------------|\n` +
6060
`| ${type.name} | ${type.fields.map((field) => field.name).join(", ")} | ${type.comment ? type.comment : ""} |`;
61-
}).join("\n");
61+
}).join("\n") : "";
6262

6363
return `# ${obj.title} documentation\n## Summary\n\n- [Introduction](#introduction)\n- [Database Type](#database-type)\n`+
6464
`- [Table Structure](#table-structure)\n${documentationSummary}\n- [Relationships](#relationships)\n- [Database Diagram](#database-Diagram)\n\n`+

0 commit comments

Comments
 (0)