Closed smurzz closed 1 year ago
Request Headers: Authentication: Bearer [access-token] Request body: {"commentText"}
Validierung:
Request Status: 201 Response Body: {"id", "title", "images", "description", "yearOfCreation", "materials, "dimension" "price", "tags", "artDirections", "location", "createdAt", "comments", "ownerId", "ownerName", "galleryId", "galleryTitle", "likes", "likedByCurrentUser"} Request Error:
400 BAD_REQUEST: commentText: darf nicht leer sein 401 UNAUTHORIZED 404 NOT_FOUND: User is not found. 404 NOT_FOUND: ArtWork is not found.
Beispiel: http://localhost:8080/artworks/64ab084a4819fc3f028c8631/comments
Beispiel Request Body:
{
"commentText": "Super!"
}
Beispiel Response Body:
{
"id": "64ab084a4819fc3f028c8631",
"title": "Mein erstes Bild",
"description": "description",
"yearOfCreation": null,
"materials": [
"material1",
"material2"
],
"tags": [],
"artDirections": [
"CONCEPTUAL_ART",
"EXPRESSIONISM"
],
"dimension": {
"height": 1.0,
"width": null,
"depth": null
},
"price": 0.0,
"location": "",
"createdAt": "2023-07-09T19:19:38.343+00:00",
"comments": [
{
"id": "5eeaf245-c20e-4343-9434-792d3a9fa31d",
"authorId": "649aa1867af2d57328bb0cb7",
"authorName": "admin",
"createdAt": "2023-07-10T00:40:13.560+00:00",
"updatedAt": null,
"text": "Super!",
"updated": false
}
],
"ownerId": "649aa1867af2d57328bb0cb7",
"galleryId": "64ab04034819fc3f028c862e",
"ownerName": "admin admin",
"galleryTitle": "Meine Galerie",
"likes": 0,
"likedByCurrentUser": false
}
Request Headers: Authentication: Bearer [access-token] Request body: {"commentText"}
Validierung:
Request Status: 200 Response Body: {"id", "title", "images", "description", "yearOfCreation", "materials, "dimension" "price", "tags", "artDirections", "location", "createdAt", "comments", "ownerId", "ownerName", "galleryId", "galleryTitle", "likes", "likedByCurrentUser"} Request Error:
400 BAD_REQUEST: commentText: darf nicht leer sein 401 UNAUTHORIZED 403 FORBIDDEN: You are not allowed to update a comment for another user 404 NOT_FOUND: User is not found. 404 NOT_FOUND: ArtWork is not found. 404 NOT_FOUND: Comment is not found
Beispiel Request Body:
{
"commentText": "Super! (Edited)"
}
Beispiel Response Body:
{
"id": "64ab084a4819fc3f028c8631",
"title": "Mein erstes Bild",
"description": "description",
"yearOfCreation": null,
"materials": [
"material1",
"material2"
],
"tags": [],
"artDirections": [
"CONCEPTUAL_ART",
"EXPRESSIONISM"
],
"dimension": {
"height": 1.0,
"width": null,
"depth": null
},
"price": 0.0,
"location": "",
"createdAt": "2023-07-09T19:19:38.343+00:00",
"comments": [
{
"id": "612cd176-d7d8-421d-92ab-bf9046460f99",
"authorId": "649aa1867af2d57328bb0cb7",
"authorName": "admin",
"createdAt": "2023-07-10T01:41:38.045+00:00",
"updatedAt": "2023-07-10T01:42:18.418+00:00",
"text": "Super! (Edited)",
"updated": true
}
],
"ownerId": "649aa1867af2d57328bb0cb7",
"galleryId": "64ab04034819fc3f028c862e",
"ownerName": "admin admin",
"galleryTitle": "Meine Galerie",
"likes": 0,
"likedByCurrentUser": false
}
Request Headers: Authentication: Bearer [access-token]
Request Status: 204 Request Error:
401 UNAUTHORIZED 403 FORBIDDEN: You are not allowed to delete a comment for another user 404 NOT_FOUND: User is not found. 404 NOT_FOUND: ArtWork is not found. 404 NOT_FOUND: Comment is not found
EndPoints: