Endpoints - Orden-der-letzten-Haltestelle/WebEngineering GitHub Wiki
π Enpoints
We have two different kinds of Roles. We have the webshop roles admin
and user
and also custome roles for wishlists: owner
, write
and read
.
Usefull link for Routing using Express: Routing
π Needed Endpoints
Action | Endpoint | Role | Payload | Description |
---|---|---|---|---|
GET | /api/products?name={name}&minPrice={x}&maxPrice={y} |
user | All products in Price Range and including the name | |
GET | /api/product/:productId |
user | Single product | |
POST | /api/product |
admin | π Product | Create a product (name, description, amount, price) |
PUT | /api/product/:productId |
admin | π Product | Update a product (name, description, amount, price) |
DELETE | /api/product/:productId |
admin | β | Delete a product |
GET | /api/cart |
user | All products in own Cart | |
DELETE | /api/cart |
user | β | Delete all products of Cart |
POST | /api/cart/product/:productId?amount={amount} |
user | π±οΈ | Add product to Cart Amount is optional will be set on 1 if not given. |
PUT | /api/cart/item/:cartItemId?amount={amount} |
user | π | Change amount of product in your cart |
DELETE | /api/cart/item/:cartItemId |
user | β | Remove product from Cart |
POST | /api/cart/buy |
user | π±οΈ | Moves products of Cart into Order |
GET | /api/cart/orders |
user | Shows all ordered products | |
GET | /api/wishlist |
read | All your Wishlists | |
GET | /api/wishlist/:wishlistId |
read | Single Wishlist (with all items in it) | |
POST | /api/wishlist |
owner | π Wishlist | Create a Wishlist |
PUT | /api/wishlist/:wishlistId |
write | π Wishlist | Update Wishlist (name, desc.) |
DELETE | /api/wishlist/:wishlistId |
owner | LΓΆscht eine Wunschliste | |
POST | /api/wishlist/:wishlistId/item?productId={...} |
write | π±οΈ | Add a product to a Wishlist (amount = 1) |
PUT | /api/wishlist/item/:wishlistItemId?amount={amount} |
write | π | Change amount of product |
DELETE | /api/wishlist/item/:wishlistItemId |
write | β | Remove product from Wishlist |
POST | /api/wishlist/:wishlistId/permission |
owner | π WishlistMemeber | Add a user to a selected Wishlist Payload hat userId und rollen des jeweiligen nutzers |
PUT | /api/wishlist/permission/:userWishlistRelationId |
owner | π Role | Change role of a user |
DELETE | /api/wishlist/permission/:userWishlistRelationId |
owner | β | Delete user from wishlist |
POST | /api/auth/register |
π User | Register a user | |
POST | /api/auth/login |
user | π User | Login of user |
POST | /api/auth/login?email={email} |
user | π Email | Login with only Email and a Link to verify |
GET | /api/auth/renew |
user | Erneuert den JWT token | |
POST | /api/auth/logout |
user | π±οΈ | Logout of current user (einfach token lΓΆschen im frontend) |
PUT | /api/auth/verify?token={...} |
user | verification with email | |
GET | /api/user |
user | Returns your User | |
GET | /api/users?name={...} |
user | Returns all Users gefiltert nach name | |
GET | /api/user/:userId |
user | Returns a single User | |
PUT | /api/user/:userId/bann |
admin | π±οΈ | Banns the User |
PUT | /api/user/:userId/unbann |
admin | π±οΈ | Unbanns the User |
PUT | /api/user/:userId/role |
admin | π Role | Change the Role of the User |
Legend
Logo | Description |
---|---|
π | Input via a Form |
π±οΈ | Input via a Button |
β | Deletion via a Button |
π§Ύ Details for each Endpoints
will be implemented