CRUD Operations on Categories
-
Add Category (POST)
URL:http://localhost:8080/api/categories
Body:{ "categoryId": 0, "categoryName": "String", "categoryDescription": "String", "products": [] }
-
Update Category (PUT)
URL:http://localhost:8080/api/categories/{id}
Body:{ "id": 0, "categoryId": 0, "categoryName": "String", "categoryDescription": "String", "products": [] }
-
Get All Categories (GET)
URL:http://localhost:8080/api/categories?page=0
-
Get Category by Id (GET)
URL:http://localhost:8080/api/categories/{id}
Body:{ "id": 0 }
-
Delete Category by Id (DELETE)
a. URL:http://localhost:8080/api/categories/{id}
Body:{ "id": 0 }
b. URL:
http://localhost:8080/api/categories/{id}?force=true
Body:{ "id": 0 }
-
Delete Category by Id (DELETE)
a. URL:http://localhost:8080/api/categories/{id}
Body:{ "id": 0 }
Description: Deletes the category with the specified ID if the product table does not contain entries associated with this category. If products exist, the category will not be deleted.
b. URL:http://localhost:8080/api/categories/{id}?force=true
Body:{ "id": 0 }
Description: Deletes the category with the specified ID along with associated products, regardless of whether products exist or not.