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

@ -10,9 +10,11 @@ import { DeleteApiRequestBuilder } from '../common/api-request-builder/delete-ap
/**
* Sets the owner of a note.
*
* @param noteId The id of the note.
* @param owner The username of the new owner.
* @return The updated note permissions.
* @return The updated {@link NotePermissions}.
* @throws {Error} when the api request wasn't successful.
*/
export const setNoteOwner = async (noteId: string, owner: string): Promise<NotePermissions> => {
const response = await new PutApiRequestBuilder<NotePermissions, OwnerChangeDto>(
@ -27,9 +29,12 @@ export const setNoteOwner = async (noteId: string, owner: string): Promise<NoteP
/**
* Sets a permission for one user of a note.
*
* @param noteId The id of the note.
* @param username The username of the user to set the permission for.
* @param canEdit true if the user should be able to update the note, false otherwise.
* @return The updated {@link NotePermissions}.
* @throws {Error} when the api request wasn't successful.
*/
export const setUserPermission = async (
noteId: string,
@ -48,9 +53,12 @@ export const setUserPermission = async (
/**
* Sets a permission for one group of a note.
*
* @param noteId The id of the note.
* @param groupName The name of the group to set the permission for.
* @param canEdit true if the group should be able to update the note, false otherwise.
* @return The updated {@link NotePermissions}.
* @throws {Error} when the api request wasn't successful.
*/
export const setGroupPermission = async (
noteId: string,
@ -69,8 +77,11 @@ export const setGroupPermission = async (
/**
* Removes the permissions of a note for a user.
*
* @param noteId The id of the note.
* @param username The name of the user to remove the permission of.
* @return The updated {@link NotePermissions}.
* @throws {Error} when the api request wasn't successful.
*/
export const removeUserPermission = async (noteId: string, username: string): Promise<NotePermissions> => {
const response = await new DeleteApiRequestBuilder<NotePermissions>(
@ -83,8 +94,11 @@ export const removeUserPermission = async (noteId: string, username: string): Pr
/**
* Removes the permissions of a note for a group.
*
* @param noteId The id of the note.
* @param groupName The name of the group to remove the permission of.
* @return The updated {@link NotePermissions}.
* @throws {Error} when the api request wasn't successful.
*/
export const removeGroupPermission = async (noteId: string, groupName: string): Promise<NotePermissions> => {
const response = await new DeleteApiRequestBuilder<NotePermissions>(