Skip to content

Commit 1baac7f

Browse files
committed
fix: make update note field optional
1 parent 44c3f35 commit 1baac7f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

nodejs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@hackmd/api",
3-
"version": "2.2.0",
3+
"version": "2.2.1",
44
"description": "HackMD Node.js API Client",
55
"main": "dist/index.js",
66
"declaration": "./dist/index.d.ts",

nodejs/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export default class API {
8282
await this.axios.patch<AxiosResponse>(`notes/${noteId}`, { content })
8383
}
8484

85-
async updateNote (noteId: string, options: Pick<SingleNote, 'content' | 'readPermission' | 'writePermission' | 'permalink'>): Promise<AxiosResponse> {
85+
async updateNote (noteId: string, options: Partial<Pick<SingleNote, 'content' | 'readPermission' | 'writePermission' | 'permalink'>>): Promise<AxiosResponse> {
8686
return await this.axios.patch<AxiosResponse>(`notes/${noteId}`, options)
8787
}
8888

@@ -109,7 +109,7 @@ export default class API {
109109
await this.axios.patch<AxiosResponse>(`teams/${teamPath}/notes/${noteId}`, { content })
110110
}
111111

112-
async updateTeamNote (teamPath: string, noteId: string, options: Pick<SingleNote, 'content' | 'readPermission' | 'writePermission' | 'permalink'>): Promise<AxiosResponse> {
112+
async updateTeamNote (teamPath: string, noteId: string, options: Partial<Pick<SingleNote, 'content' | 'readPermission' | 'writePermission' | 'permalink'>>): Promise<AxiosResponse> {
113113
return await this.axios.patch<AxiosResponse>(`teams/${teamPath}/notes/${noteId}`, options)
114114
}
115115

0 commit comments

Comments
 (0)