Skip to content

Commit

Permalink
Merge pull request #22 from hackmdio/feature/api-update
Browse files Browse the repository at this point in the history
API Update
  • Loading branch information
Yukaii authored Aug 22, 2022
2 parents 2063504 + d48356d commit 465079a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions nodejs/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export default class API {
await this.axios.patch<AxiosResponse>(`notes/${noteId}`, { content })
}

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

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

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

Expand Down
5 changes: 3 additions & 2 deletions nodejs/src/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ export type CreateNoteOptions = {
content?: string
readPermission?: NotePermissionRole,
writePermission?: NotePermissionRole,
commentPermission?: CommentPermissionType
commentPermission?: CommentPermissionType,
permalink?: string
}

export type Team = {
Expand Down Expand Up @@ -74,10 +75,10 @@ export type Note = {
teamPath: string | null
permalink: string | null
shortId: string
publishLink: string

readPermission: NotePermissionRole
writePermission: NotePermissionRole

}

export type SingleNote = Note & {
Expand Down

0 comments on commit 465079a

Please sign in to comment.