From 46ad28bc1becbf9eed157eeacb6767aeb8ad1c79 Mon Sep 17 00:00:00 2001 From: Aelita4 Date: Tue, 18 Jun 2024 22:09:49 +0200 Subject: [PATCH] Add changeUserData to API docs --- API.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/API.md b/API.md index 202326f..f8ec5fd 100644 --- a/API.md +++ b/API.md @@ -15,6 +15,7 @@ - [/research/getResearch](#researchgetresearch) - [/research/performResearch](#researchperformresearch) - [/build/createBuilding](#buildcreatebuilding) + - [/auth/changeUserData](#authchangeuserdata) # 1. Description of custom types @@ -233,6 +234,35 @@ updatedAt: Date } ``` +**OUTPUT:** +```json +{ + "code": 200, + "message": "OK" +} +``` + +## /auth/changeUserData + +**URL: PATCH** /auth/changeUserData/*:type* + +**DESCRIPTION:** Used to change user username, email or password. Type A access token required via Authorization header in addition to current password in body + +Type can be one of (anything other will throw ***400 Bad Request***): +- username +- email +- password + +**BODY:** +```json +{ + "password": "string", + "newUsername": "string", + "newEmail": "string", + "newPassword": "string" +} +``` + **OUTPUT:** ```json {