mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-29 06:15:29 -04:00
docs: consolidate docs (#2182)
Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
8d46d7e39e
commit
ecffebc43c
307 changed files with 1474 additions and 487 deletions
|
@ -11,8 +11,10 @@ import { DeleteApiRequestBuilder } from '../common/api-request-builder/delete-ap
|
|||
|
||||
/**
|
||||
* Retrieves the content and metadata about the specified note.
|
||||
*
|
||||
* @param noteIdOrAlias The id or alias of the note.
|
||||
* @return Content and metadata of the specified note.
|
||||
* @throws {Error} when the api request wasn't successful.
|
||||
*/
|
||||
export const getNote = async (noteIdOrAlias: string): Promise<Note> => {
|
||||
const response = await new GetApiRequestBuilder<Note>('notes/' + noteIdOrAlias)
|
||||
|
@ -23,8 +25,10 @@ export const getNote = async (noteIdOrAlias: string): Promise<Note> => {
|
|||
|
||||
/**
|
||||
* Returns a list of media objects associated with the specified note.
|
||||
*
|
||||
* @param noteIdOrAlias The id or alias of the note.
|
||||
* @return List of media object metadata associated with specified note.
|
||||
* @throws {Error} when the api request wasn't successful.
|
||||
*/
|
||||
export const getMediaForNote = async (noteIdOrAlias: string): Promise<MediaUpload[]> => {
|
||||
const response = await new GetApiRequestBuilder<MediaUpload[]>(`notes/${noteIdOrAlias}/media`).sendRequest()
|
||||
|
@ -33,8 +37,10 @@ export const getMediaForNote = async (noteIdOrAlias: string): Promise<MediaUploa
|
|||
|
||||
/**
|
||||
* Creates a new note with a given markdown content.
|
||||
*
|
||||
* @param markdown The content of the new note.
|
||||
* @return Content and metadata of the new note.
|
||||
* @throws {Error} when the api request wasn't successful.
|
||||
*/
|
||||
export const createNote = async (markdown: string): Promise<Note> => {
|
||||
const response = await new PostApiRequestBuilder<Note, void>('notes')
|
||||
|
@ -46,9 +52,11 @@ export const createNote = async (markdown: string): Promise<Note> => {
|
|||
|
||||
/**
|
||||
* Creates a new note with a given markdown content and a defined primary alias.
|
||||
*
|
||||
* @param markdown The content of the new note.
|
||||
* @param primaryAlias The primary alias of the new note.
|
||||
* @return Content and metadata of the new note.
|
||||
* @throws {Error} when the api request wasn't successful.
|
||||
*/
|
||||
export const createNoteWithPrimaryAlias = async (markdown: string, primaryAlias: string): Promise<Note> => {
|
||||
const response = await new PostApiRequestBuilder<Note, void>('notes/' + primaryAlias)
|
||||
|
@ -60,7 +68,9 @@ export const createNoteWithPrimaryAlias = async (markdown: string, primaryAlias:
|
|||
|
||||
/**
|
||||
* Deletes the specified note.
|
||||
*
|
||||
* @param noteIdOrAlias The id or alias of the note to delete.
|
||||
* @throws {Error} when the api request wasn't successful.
|
||||
*/
|
||||
export const deleteNote = async (noteIdOrAlias: string): Promise<void> => {
|
||||
await new DeleteApiRequestBuilder('notes/' + noteIdOrAlias).sendRequest()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue