Skip to content

Changed the title parameter to optional when creating a database in both README.md and index.ts. #38

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,9 @@ All tools support the following optional parameter:
- Create a new database.
- Required inputs:
- `parent` (object): Parent object of the database.
- `title` (array): Title of the database as a rich text array.
- `properties` (object): Property schema of the database.
- Optional inputs:
- `title` (array): Title of the database as a rich text array.
- Returns: Information about the created database.

8. `notion_query_database`
Expand Down
10 changes: 5 additions & 5 deletions notion/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ interface CreateDatabaseArgs {
database_id?: string;
workspace?: boolean;
};
title: RichTextItemResponse[];
title?: RichTextItemResponse[];
properties: Record<string, any>;
format?: "json" | "markdown";
}
Expand Down Expand Up @@ -1075,8 +1075,8 @@ export class NotionClientWrapper {

async createDatabase(
parent: CreateDatabaseArgs["parent"],
title: RichTextItemResponse[],
properties: Record<string, any>
properties: Record<string, any>,
title?: RichTextItemResponse[],
): Promise<DatabaseResponse> {
const body = { parent, title, properties };

Expand Down Expand Up @@ -1413,8 +1413,8 @@ async function main() {
.arguments as unknown as CreateDatabaseArgs;
response = await notionClient.createDatabase(
args.parent,
args.title,
args.properties
args.properties,
args.title
);
break;
}
Expand Down