Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
IP1_Gruppe8
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Privacy
Imprint
Contact
Snippets
Groups
Projects
Show more breadcrumbs
Sophia Haupt
IP1_Gruppe8
Commits
72b2cc04
Commit
72b2cc04
authored
1 month ago
by
Victoria Badeke
Browse files
Options
Downloads
Patches
Plain Diff
datenbank
parent
a850f877
Branches
apidoc-vici-admin
Branches containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
userman_all/server/doc/index.html
+10
-10
10 additions, 10 deletions
userman_all/server/doc/index.html
userman_all/server/src/server.ts
+47
-0
47 additions, 0 deletions
userman_all/server/src/server.ts
with
57 additions
and
10 deletions
userman_all/server/doc/index.html
+
10
−
10
View file @
72b2cc04
...
@@ -5,15 +5,15 @@
...
@@ -5,15 +5,15 @@
<meta
name=
"description"
content=
"horizon changers website"
>
<meta
name=
"description"
content=
"horizon changers website"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=UTF-8"
>
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=UTF-8"
>
<link
href=
"assets/bootstrap.min.css?v=173771
6477426
"
rel=
"stylesheet"
media=
"screen"
>
<link
href=
"assets/bootstrap.min.css?v=173771
9621971
"
rel=
"stylesheet"
media=
"screen"
>
<link
href=
"assets/prism.css?v=173771
6477426
"
rel=
"stylesheet"
/>
<link
href=
"assets/prism.css?v=173771
9621971
"
rel=
"stylesheet"
/>
<link
href=
"assets/prism-toolbar.css?v=173771
6477426
"
rel=
"stylesheet"
/>
<link
href=
"assets/prism-toolbar.css?v=173771
9621971
"
rel=
"stylesheet"
/>
<link
href=
"assets/prism-diff-highlight.css?v=173771
6477426
"
rel=
"stylesheet"
/>
<link
href=
"assets/prism-diff-highlight.css?v=173771
9621971
"
rel=
"stylesheet"
/>
<link
href=
"assets/main.css?v=173771
6477426
"
rel=
"stylesheet"
media=
"screen, print"
>
<link
href=
"assets/main.css?v=173771
9621971
"
rel=
"stylesheet"
media=
"screen, print"
>
<link
href=
"assets/favicon.ico?v=173771
6477426
"
rel=
"icon"
type=
"image/x-icon"
>
<link
href=
"assets/favicon.ico?v=173771
9621971
"
rel=
"icon"
type=
"image/x-icon"
>
<link
href=
"assets/apple-touch-icon.png?v=173771
6477426
"
rel=
"apple-touch-icon"
sizes=
"180x180"
>
<link
href=
"assets/apple-touch-icon.png?v=173771
9621971
"
rel=
"apple-touch-icon"
sizes=
"180x180"
>
<link
href=
"assets/favicon-32x32.png?v=173771
6477426
"
rel=
"icon"
type=
"image/png"
sizes=
"32x32"
>
<link
href=
"assets/favicon-32x32.png?v=173771
9621971
"
rel=
"icon"
type=
"image/png"
sizes=
"32x32"
>
<link
href=
"assets/favicon-16x16.png?v=173771
6477426
"
rel=
"icon"
type=
"image/png"
sizes=
"16x16"
>
<link
href=
"assets/favicon-16x16.png?v=173771
9621971
"
rel=
"icon"
type=
"image/png"
sizes=
"16x16"
>
</head>
</head>
<body
class=
"container-fluid"
>
<body
class=
"container-fluid"
>
...
@@ -1042,6 +1042,6 @@
...
@@ -1042,6 +1042,6 @@
</div>
</div>
</div>
</div>
<script
src=
"assets/main.bundle.js?v=17377
09870186
"
></script>
<script
src=
"assets/main.bundle.js?v=17377
19621971
"
></script>
</body>
</body>
</html>
</html>
This diff is collapsed.
Click to expand it.
userman_all/server/src/server.ts
+
47
−
0
View file @
72b2cc04
...
@@ -594,6 +594,53 @@ app.put('/user', isLoggedIn, async (req: Request, res: Response): Promise<void>
...
@@ -594,6 +594,53 @@ app.put('/user', isLoggedIn, async (req: Request, res: Response): Promise<void>
}
}
});
});
/**
* @api {put} /user/:userId Aktualisiere Benutzerdaten
* @apiName UpdateUser
* @apiGroup Admin
* @apiPermission loggedIn
*
* @apiDescription Diese Route ermöglicht es dem Admin, die Daten eines bestimmten Benutzers zu aktualisieren.
* Der Admin muss eingeloggt sein, um diese Route nutzen zu können.
*
* @apiParam {Number} userId Die ID des zu aktualisierenden Benutzers. (Pflichtfeld)
*
* @apiBody {String} firstName Vorname des Benutzers. (Pflichtfeld)
* @apiBody {String} lastName Nachname des Benutzers. (Pflichtfeld)
* @apiBody {String} eMail E-Mail-Adresse des Benutzers. (Pflichtfeld)
* @apiBody {String} adress Adresse des Benutzers. (Optional)
* @apiBody {String} role Rolle des Benutzers. (Pflichtfeld)
*
* @apiSuccess {String} message Erfolgsmeldung, dass die Benutzerdaten erfolgreich aktualisiert wurden.
*
* @apiError {Number} 400 Fehlende Pflichtfelder: Es wurden nicht alle erforderlichen Felder ausgefüllt.
* @apiError {Number} 404 Benutzer nicht gefunden: Der Benutzer konnte in der Datenbank nicht gefunden werden.
* @apiError {Number} 500 Datenbankfehler: Es gab ein Problem mit der Datenbankanfrage.
*
* @apiSuccessExample Success-Response:
* HTTP/1.1 200 OK
* {
* "message": "Successfully updated user John Doe"
* }
*
* @apiErrorExample {json} Fehlende Pflichtfelder:
* HTTP/1.1 400 Bad Request
* {
* "message": "Not all mandatory fields are filled in"
* }
*
* @apiErrorExample {json} Benutzer nicht gefunden:
* HTTP/1.1 404 Not Found
* {
* "message": "The user to update could not be found"
* }
*
* @apiErrorExample {json} Datenbankfehler:
* HTTP/1.1 500 Internal Server Error
* {
* "message": "Database request failed: [Fehlermeldung]"
* }
*/
// update route admin
// update route admin
app
.
put
(
'
/user/:userId
'
,
isLoggedIn
,
async
(
req
:
Request
,
res
:
Response
):
Promise
<
void
>
=>
{
app
.
put
(
'
/user/:userId
'
,
isLoggedIn
,
async
(
req
:
Request
,
res
:
Response
):
Promise
<
void
>
=>
{
console
.
log
(
req
.
body
);
console
.
log
(
req
.
body
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment