docs: consolidate docs (#2182)

Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
Philip Molares 2022-07-21 22:36:46 +02:00 committed by GitHub
parent 8d46d7e39e
commit ecffebc43c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
307 changed files with 1474 additions and 487 deletions

View file

@ -9,8 +9,10 @@ import { DeleteApiRequestBuilder } from '../common/api-request-builder/delete-ap
/**
* Requests an image-proxy URL from the backend for a given image URL.
*
* @param imageUrl The image URL which should be proxied.
* @return The proxy URL for the image.
* @throws {Error} when the api request wasn't successful.
*/
export const getProxiedUrl = async (imageUrl: string): Promise<ImageProxyResponse> => {
const response = await new PostApiRequestBuilder<ImageProxyResponse, ImageProxyRequestDto>('media/proxy')
@ -23,9 +25,11 @@ export const getProxiedUrl = async (imageUrl: string): Promise<ImageProxyRespons
/**
* Uploads a media file to the backend.
*
* @param noteIdOrAlias The id or alias of the note from which the media is uploaded.
* @param media The binary media content.
* @return The URL of the uploaded media object.
* @throws {Error} when the api request wasn't successful.
*/
export const uploadFile = async (noteIdOrAlias: string, media: Blob): Promise<MediaUpload> => {
const postData = new FormData()
@ -40,7 +44,9 @@ export const uploadFile = async (noteIdOrAlias: string, media: Blob): Promise<Me
/**
* Deletes some uploaded media object.
*
* @param mediaId The identifier of the media object to delete.
* @throws {Error} when the api request wasn't successful.
*/
export const deleteUploadedMedia = async (mediaId: string): Promise<void> => {
await new DeleteApiRequestBuilder('media/' + mediaId).sendRequest()