Skip to content

Commit cddad41

Browse files
authored
Merge pull request #290 from Yuvraj3905/main
fix: correct schema writing method from tenancy.create to schema.write
2 parents 53e781e + dbb0996 commit cddad41

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

README.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,18 @@ let schema = `
109109
}
110110
`;
111111

112-
// Write the schema
113-
client.tenancy
114-
.create({
115-
tenantId: "t1",
116-
schema: schema,
117-
})
118-
.then((response) => {
119-
// handle response
120-
});
112+
// Write the schema using the correct method
113+
client.schema.write({
114+
tenantId: "t1",
115+
schema: schema,
116+
})
117+
.then((response) => {
118+
console.log("Schema written successfully:", response);
119+
// handle response - typically contains schemaVersion
120+
})
121+
.catch((error) => {
122+
console.error("Error writing schema:", error);
123+
});
121124
```
122125

123126
### 4. Relationship Management

0 commit comments

Comments
 (0)