diff --git a/postman/reactredux.postman_collection.json b/postman/reactredux.postman_collection.json
index b7b770a..e5f987b 100644
--- a/postman/reactredux.postman_collection.json
+++ b/postman/reactredux.postman_collection.json
@@ -49,7 +49,7 @@
]
},
{
- "name": "ShopCartItems",
+ "name": "CategoryItem",
"item": [
{
"name": "01-Get",
@@ -68,7 +68,7 @@
}
],
"url": {
- "raw": "https://localhost:7151/api/ShopCartItems/404c8232-9048-4519-bfba-6e78dc7005ca/fdc5aa50-ee68-4bae-a8e6-b8ae2c258f60?locale=en-US",
+ "raw": "https://localhost:7151/api/CategoryItem/404c8232-9048-4519-bfba-6e78dc7005ca/e154e33f-3cc7-468d-bb66-e0390ddb9ae0",
"protocol": "https",
"host": [
"localhost"
@@ -76,9 +76,222 @@
"port": "7151",
"path": [
"api",
- "ShopCartItems",
+ "CategoryItem",
"404c8232-9048-4519-bfba-6e78dc7005ca",
- "fdc5aa50-ee68-4bae-a8e6-b8ae2c258f60"
+ "e154e33f-3cc7-468d-bb66-e0390ddb9ae0"
+ ]
+ }
+ },
+ "response": []
+ },
+ {
+ "name": "02-GetSlug",
+ "request": {
+ "method": "GET",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json",
+ "type": "default"
+ },
+ {
+ "key": "Accept",
+ "value": "application/json",
+ "type": "default"
+ }
+ ],
+ "url": {
+ "raw": "https://localhost:7151/api/CategoryItem/404c8232-9048-4519-bfba-6e78dc7005ca?slug=default",
+ "protocol": "https",
+ "host": [
+ "localhost"
+ ],
+ "port": "7151",
+ "path": [
+ "api",
+ "CategoryItem",
+ "404c8232-9048-4519-bfba-6e78dc7005ca"
+ ],
+ "query": [
+ {
+ "key": "slug",
+ "value": "default"
+ }
+ ]
+ }
+ },
+ "response": []
+ },
+ {
+ "name": "03-Post",
+ "request": {
+ "method": "POST",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json",
+ "type": "default"
+ },
+ {
+ "key": "Accept",
+ "value": "application/json",
+ "type": "default"
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\r\n \"l10n\": [\r\n {\r\n \"locale\": \"\",\r\n \"slug\": \"guides\",\r\n \"text\": \"Guides\"\r\n }\r\n ]\r\n}"
+ },
+ "url": {
+ "raw": "https://localhost:7151/api/CategoryItem/404c8232-9048-4519-bfba-6e78dc7005ca",
+ "protocol": "https",
+ "host": [
+ "localhost"
+ ],
+ "port": "7151",
+ "path": [
+ "api",
+ "CategoryItem",
+ "404c8232-9048-4519-bfba-6e78dc7005ca"
+ ]
+ }
+ },
+ "response": []
+ },
+ {
+ "name": "04-Put",
+ "request": {
+ "method": "PUT",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json",
+ "type": "default"
+ },
+ {
+ "key": "Accept",
+ "value": "application/json",
+ "type": "default"
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\r\n \"l10n\": [\r\n {\r\n \"locale\": \"en-US\",\r\n \"slug\": \"guides\",\r\n \"text\": \"Guides\"\r\n },\r\n {\r\n \"locale\": \"it-IT\",\r\n \"slug\": \"guide\",\r\n \"text\": \"Guide\"\r\n }\r\n ]\r\n}"
+ },
+ "url": {
+ "raw": "https://localhost:7151/api/CategoryItem/404c8232-9048-4519-bfba-6e78dc7005ca/2c50f4de-70f2-4414-aabc-7a0d2eb0e203",
+ "protocol": "https",
+ "host": [
+ "localhost"
+ ],
+ "port": "7151",
+ "path": [
+ "api",
+ "CategoryItem",
+ "404c8232-9048-4519-bfba-6e78dc7005ca",
+ "2c50f4de-70f2-4414-aabc-7a0d2eb0e203"
+ ]
+ }
+ },
+ "response": []
+ },
+ {
+ "name": "05-Delete",
+ "request": {
+ "method": "DELETE",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json",
+ "type": "default"
+ },
+ {
+ "key": "Accept",
+ "value": "application/json",
+ "type": "default"
+ }
+ ],
+ "url": {
+ "raw": "https://localhost:7151/api/CategoryItem/404c8232-9048-4519-bfba-6e78dc7005ca/2c50f4de-70f2-4414-aabc-7a0d2eb0e203",
+ "protocol": "https",
+ "host": [
+ "localhost"
+ ],
+ "port": "7151",
+ "path": [
+ "api",
+ "CategoryItem",
+ "404c8232-9048-4519-bfba-6e78dc7005ca",
+ "2c50f4de-70f2-4414-aabc-7a0d2eb0e203"
+ ]
+ }
+ },
+ "response": []
+ }
+ ]
+ },
+ {
+ "name": "CategoryItems",
+ "item": [
+ {
+ "name": "01-Get",
+ "request": {
+ "method": "GET",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json",
+ "type": "default"
+ },
+ {
+ "key": "Accept",
+ "value": "application/json",
+ "type": "default"
+ }
+ ],
+ "url": {
+ "raw": "https://localhost:7151/api/CategoryItems/404c8232-9048-4519-bfba-6e78dc7005ca",
+ "protocol": "https",
+ "host": [
+ "localhost"
+ ],
+ "port": "7151",
+ "path": [
+ "api",
+ "CategoryItems",
+ "404c8232-9048-4519-bfba-6e78dc7005ca"
+ ]
+ }
+ },
+ "response": []
+ },
+ {
+ "name": "02-Get localized",
+ "request": {
+ "method": "GET",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json",
+ "type": "default"
+ },
+ {
+ "key": "Accept",
+ "value": "application/json",
+ "type": "default"
+ }
+ ],
+ "url": {
+ "raw": "https://localhost:7151/api/CategoryItems/404c8232-9048-4519-bfba-6e78dc7005ca?locale=en-US",
+ "protocol": "https",
+ "host": [
+ "localhost"
+ ],
+ "port": "7151",
+ "path": [
+ "api",
+ "CategoryItems",
+ "404c8232-9048-4519-bfba-6e78dc7005ca"
],
"query": [
{
@@ -89,6 +302,346 @@
}
},
"response": []
+ },
+ {
+ "name": "03-Delete",
+ "request": {
+ "method": "DELETE",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json",
+ "type": "default"
+ },
+ {
+ "key": "Accept",
+ "value": "application/json",
+ "type": "default"
+ }
+ ],
+ "url": {
+ "raw": "https://localhost:7151/api/CategoryItems/404c8232-9048-4519-bfba-6e78dc7005ca",
+ "protocol": "https",
+ "host": [
+ "localhost"
+ ],
+ "port": "7151",
+ "path": [
+ "api",
+ "CategoryItems",
+ "404c8232-9048-4519-bfba-6e78dc7005ca"
+ ]
+ }
+ },
+ "response": []
+ }
+ ]
+ },
+ {
+ "name": "ShopItem",
+ "item": [
+ {
+ "name": "01-Get",
+ "request": {
+ "method": "GET",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json",
+ "type": "default"
+ },
+ {
+ "key": "Accept",
+ "value": "application/json",
+ "type": "default"
+ }
+ ],
+ "url": {
+ "raw": "https://localhost:7151/api/ShopItem/404c8232-9048-4519-bfba-6e78dc7005ca/SKU-01",
+ "protocol": "https",
+ "host": [
+ "localhost"
+ ],
+ "port": "7151",
+ "path": [
+ "api",
+ "ShopItem",
+ "404c8232-9048-4519-bfba-6e78dc7005ca",
+ "SKU-01"
+ ]
+ }
+ },
+ "response": []
+ },
+ {
+ "name": "02-GetSlug",
+ "request": {
+ "method": "GET",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json",
+ "type": "default"
+ },
+ {
+ "key": "Accept",
+ "value": "application/json",
+ "type": "default"
+ }
+ ],
+ "url": {
+ "raw": "https://localhost:7151/api/ShopItem/404c8232-9048-4519-bfba-6e78dc7005ca?slug=shop-catalog-item-01",
+ "protocol": "https",
+ "host": [
+ "localhost"
+ ],
+ "port": "7151",
+ "path": [
+ "api",
+ "ShopItem",
+ "404c8232-9048-4519-bfba-6e78dc7005ca"
+ ],
+ "query": [
+ {
+ "key": "slug",
+ "value": "shop-catalog-item-01"
+ }
+ ]
+ }
+ },
+ "response": []
+ },
+ {
+ "name": "03-Post",
+ "request": {
+ "method": "POST",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json",
+ "type": "default"
+ },
+ {
+ "key": "Accept",
+ "value": "application/json",
+ "type": "default"
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\r\n \"l10n\":[\r\n {\r\n \"locale\":\"en-US\",\r\n \"slug\":\"shop-catalog-item-05\",\r\n \"description\": \"Descritpion...\",\r\n \"title\":\"Shop item title\",\r\n \"shortText\":\"Shor text...\",\r\n \"text\":\"Text...\",\r\n \"contentType\": \"HTML\",\r\n \"badges\":[\r\n \"sale\"\r\n ]\r\n }\r\n ],\r\n \r\n \"tags\":[\r\n \"react\",\r\n \"redux\",\r\n \"webapi\"\r\n ],\r\n \"categories\":[\r\n \"e154e33f-3cc7-468d-bb66-e0390ddb9ae0\"\r\n ],\r\n \"brandName\":\"Mongodb Brand & Name\",\r\n \"rating\":4.5,\r\n \"price\":20,\r\n \"newPrice\":10,\r\n \"quantity\":100\r\n}"
+ },
+ "url": {
+ "raw": "https://localhost:7151/api/ShopItem/404c8232-9048-4519-bfba-6e78dc7005ca/SKU-05",
+ "protocol": "https",
+ "host": [
+ "localhost"
+ ],
+ "port": "7151",
+ "path": [
+ "api",
+ "ShopItem",
+ "404c8232-9048-4519-bfba-6e78dc7005ca",
+ "SKU-05"
+ ]
+ }
+ },
+ "response": []
+ },
+ {
+ "name": "04-Put",
+ "request": {
+ "method": "PUT",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json",
+ "type": "default"
+ },
+ {
+ "key": "Accept",
+ "value": "application/json",
+ "type": "default"
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\r\n \"l10n\":[\r\n {\r\n \"locale\":\"en-US\",\r\n \"slug\":\"shop-catalog-item-05\",\r\n \"description\": \"New Descritpion...\",\r\n \"title\":\"Shop item title\",\r\n \"shortText\":\"New Shor text...\",\r\n \"text\":\"New Text...\",\r\n \"contentType\": \"HTML\",\r\n \"badges\":[\r\n \"sale\"\r\n ]\r\n }\r\n ],\r\n \r\n \"tags\":[\r\n \"react\",\r\n \"redux\",\r\n \"webapi\"\r\n ],\r\n \"categories\":[\r\n \"e154e33f-3cc7-468d-bb66-e0390ddb9ae0\"\r\n ],\r\n \"brandName\":\"Mongodb Brand & Name\",\r\n \"rating\":4.5,\r\n \"price\":20,\r\n \"newPrice\":10,\r\n \"quantity\":100\r\n}"
+ },
+ "url": {
+ "raw": "https://localhost:7151/api/ShopItem/404c8232-9048-4519-bfba-6e78dc7005ca/SKU-05",
+ "protocol": "https",
+ "host": [
+ "localhost"
+ ],
+ "port": "7151",
+ "path": [
+ "api",
+ "ShopItem",
+ "404c8232-9048-4519-bfba-6e78dc7005ca",
+ "SKU-05"
+ ]
+ }
+ },
+ "response": []
+ },
+ {
+ "name": "05-Delete",
+ "request": {
+ "method": "DELETE",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json",
+ "type": "default"
+ },
+ {
+ "key": "Accept",
+ "value": "application/json",
+ "type": "default"
+ }
+ ],
+ "url": {
+ "raw": "https://localhost:7151/api/ShopItem/404c8232-9048-4519-bfba-6e78dc7005ca/SKU-05",
+ "protocol": "https",
+ "host": [
+ "localhost"
+ ],
+ "port": "7151",
+ "path": [
+ "api",
+ "ShopItem",
+ "404c8232-9048-4519-bfba-6e78dc7005ca",
+ "SKU-05"
+ ]
+ }
+ },
+ "response": []
+ }
+ ]
+ },
+ {
+ "name": "ShopItems",
+ "item": [
+ {
+ "name": "01-Get",
+ "request": {
+ "method": "GET",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json",
+ "type": "default"
+ },
+ {
+ "key": "Accept",
+ "value": "application/json",
+ "type": "default"
+ }
+ ],
+ "url": {
+ "raw": "https://localhost:7151/api/ShopItems/404c8232-9048-4519-bfba-6e78dc7005ca?currentPage=1&itemsPerPage=4",
+ "protocol": "https",
+ "host": [
+ "localhost"
+ ],
+ "port": "7151",
+ "path": [
+ "api",
+ "ShopItems",
+ "404c8232-9048-4519-bfba-6e78dc7005ca"
+ ],
+ "query": [
+ {
+ "key": "currentPage",
+ "value": "1"
+ },
+ {
+ "key": "itemsPerPage",
+ "value": "4"
+ }
+ ]
+ }
+ },
+ "response": []
+ },
+ {
+ "name": "02-Get localized",
+ "request": {
+ "method": "GET",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json",
+ "type": "default"
+ },
+ {
+ "key": "Accept",
+ "value": "application/json",
+ "type": "default"
+ }
+ ],
+ "url": {
+ "raw": "https://localhost:7151/api/ShopItems/404c8232-9048-4519-bfba-6e78dc7005ca?currentPage=2&itemsPerPage=2&locale=en-US",
+ "protocol": "https",
+ "host": [
+ "localhost"
+ ],
+ "port": "7151",
+ "path": [
+ "api",
+ "ShopItems",
+ "404c8232-9048-4519-bfba-6e78dc7005ca"
+ ],
+ "query": [
+ {
+ "key": "currentPage",
+ "value": "2"
+ },
+ {
+ "key": "itemsPerPage",
+ "value": "2"
+ },
+ {
+ "key": "locale",
+ "value": "en-US"
+ }
+ ]
+ }
+ },
+ "response": []
+ },
+ {
+ "name": "03-Delete",
+ "request": {
+ "method": "DELETE",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json",
+ "type": "default"
+ },
+ {
+ "key": "Accept",
+ "value": "application/json",
+ "type": "default"
+ }
+ ],
+ "url": {
+ "raw": "https://localhost:7151/api/ShopItems/404c8232-9048-4519-bfba-6e78dc7005ca",
+ "protocol": "https",
+ "host": [
+ "localhost"
+ ],
+ "port": "7151",
+ "path": [
+ "api",
+ "ShopItems",
+ "404c8232-9048-4519-bfba-6e78dc7005ca"
+ ]
+ }
+ },
+ "response": []
}
]
},
@@ -112,7 +665,7 @@
}
],
"url": {
- "raw": "https://localhost:7151/api/ShopCartItem/404c8232-9048-4519-bfba-6e78dc7005ca/fdc5aa50-ee68-4bae-a8e6-b8ae2c258f60/SKU-01?locale=en-US",
+ "raw": "https://localhost:7151/api/ShopCartItem/404c8232-9048-4519-bfba-6e78dc7005ca/fdc5aa50-ee68-4bae-a8e6-b8ae2c258f60/SKU-04?locale=en-US",
"protocol": "https",
"host": [
"localhost"
@@ -123,7 +676,7 @@
"ShopCartItem",
"404c8232-9048-4519-bfba-6e78dc7005ca",
"fdc5aa50-ee68-4bae-a8e6-b8ae2c258f60",
- "SKU-01"
+ "SKU-04"
],
"query": [
{
@@ -156,7 +709,7 @@
"raw": "{\r\n \"quantity\": 1\r\n}"
},
"url": {
- "raw": "https://localhost:7151/api/ShopCartItem/404c8232-9048-4519-bfba-6e78dc7005ca/fdc5aa50-ee68-4bae-a8e6-b8ae2c258f60/SKU-04",
+ "raw": "https://localhost:7151/api/ShopCartItem/404c8232-9048-4519-bfba-6e78dc7005ca/fdc5aa50-ee68-4bae-a8e6-b8ae2c258f60/SKU-05",
"protocol": "https",
"host": [
"localhost"
@@ -167,7 +720,7 @@
"ShopCartItem",
"404c8232-9048-4519-bfba-6e78dc7005ca",
"fdc5aa50-ee68-4bae-a8e6-b8ae2c258f60",
- "SKU-04"
+ "SKU-05"
]
}
},
@@ -248,50 +801,8 @@
]
},
{
- "name": "ShopItems",
+ "name": "ShopCartItems",
"item": [
- {
- "name": "01-Get",
- "request": {
- "method": "GET",
- "header": [
- {
- "key": "Content-Type",
- "value": "application/json",
- "type": "default"
- },
- {
- "key": "Accept",
- "value": "application/json",
- "type": "default"
- }
- ],
- "url": {
- "raw": "https://localhost:7151/api/ShopItems/404c8232-9048-4519-bfba-6e78dc7005ca?currentPage=1&itemsPerPage=4",
- "protocol": "https",
- "host": [
- "localhost"
- ],
- "port": "7151",
- "path": [
- "api",
- "ShopItems",
- "404c8232-9048-4519-bfba-6e78dc7005ca"
- ],
- "query": [
- {
- "key": "currentPage",
- "value": "1"
- },
- {
- "key": "itemsPerPage",
- "value": "4"
- }
- ]
- }
- },
- "response": []
- },
{
"name": "01-Get localized",
"request": {
@@ -309,7 +820,7 @@
}
],
"url": {
- "raw": "https://localhost:7151/api/ShopItems/404c8232-9048-4519-bfba-6e78dc7005ca?currentPage=2&itemsPerPage=2&locale=en-US",
+ "raw": "https://localhost:7151/api/ShopCartItems/404c8232-9048-4519-bfba-6e78dc7005ca/fdc5aa50-ee68-4bae-a8e6-b8ae2c258f60?locale=en-US",
"protocol": "https",
"host": [
"localhost"
@@ -317,18 +828,11 @@
"port": "7151",
"path": [
"api",
- "ShopItems",
- "404c8232-9048-4519-bfba-6e78dc7005ca"
+ "ShopCartItems",
+ "404c8232-9048-4519-bfba-6e78dc7005ca",
+ "fdc5aa50-ee68-4bae-a8e6-b8ae2c258f60"
],
"query": [
- {
- "key": "currentPage",
- "value": "2"
- },
- {
- "key": "itemsPerPage",
- "value": "2"
- },
{
"key": "locale",
"value": "en-US"
@@ -339,7 +843,7 @@
"response": []
},
{
- "name": "01-Delete",
+ "name": "02-Delete",
"request": {
"method": "DELETE",
"header": [
@@ -355,7 +859,7 @@
}
],
"url": {
- "raw": "https://localhost:7151/api/ShopItems/404c8232-9048-4519-bfba-6e78dc7005ca",
+ "raw": "https://localhost:7151/api/ShopCartItems/404c8232-9048-4519-bfba-6e78dc7005ca/fdc5aa50-ee68-4bae-a8e6-b8ae2c258f60",
"protocol": "https",
"host": [
"localhost"
@@ -363,8 +867,9 @@
"port": "7151",
"path": [
"api",
- "ShopItems",
- "404c8232-9048-4519-bfba-6e78dc7005ca"
+ "ShopCartItems",
+ "404c8232-9048-4519-bfba-6e78dc7005ca",
+ "fdc5aa50-ee68-4bae-a8e6-b8ae2c258f60"
]
}
},
@@ -373,7 +878,7 @@
]
},
{
- "name": "ShopItem",
+ "name": "BlogItem",
"item": [
{
"name": "01-Get",
@@ -392,7 +897,7 @@
}
],
"url": {
- "raw": "https://localhost:7151/api/ShopItem/404c8232-9048-4519-bfba-6e78dc7005ca/SKU-01",
+ "raw": "https://localhost:7151/api/BlogItem/404c8232-9048-4519-bfba-6e78dc7005ca/11f2f5f8-1270-4640-b082-c2e7ea8e60b4",
"protocol": "https",
"host": [
"localhost"
@@ -400,16 +905,16 @@
"port": "7151",
"path": [
"api",
- "ShopItem",
+ "BlogItem",
"404c8232-9048-4519-bfba-6e78dc7005ca",
- "SKU-01"
+ "11f2f5f8-1270-4640-b082-c2e7ea8e60b4"
]
}
},
"response": []
},
{
- "name": "01-GetSlug",
+ "name": "02-GetSlug",
"request": {
"method": "GET",
"header": [
@@ -425,7 +930,7 @@
}
],
"url": {
- "raw": "https://localhost:7151/api/ShopItem/404c8232-9048-4519-bfba-6e78dc7005ca?slug=shop-catalog-item-01",
+ "raw": "https://localhost:7151/api/BlogItem/404c8232-9048-4519-bfba-6e78dc7005ca?slug=privacy-terms-and-conditions",
"protocol": "https",
"host": [
"localhost"
@@ -433,13 +938,13 @@
"port": "7151",
"path": [
"api",
- "ShopItem",
+ "BlogItem",
"404c8232-9048-4519-bfba-6e78dc7005ca"
],
"query": [
{
"key": "slug",
- "value": "shop-catalog-item-01"
+ "value": "privacy-terms-and-conditions"
}
]
}
@@ -447,7 +952,7 @@
"response": []
},
{
- "name": "02-Post",
+ "name": "03-Post",
"request": {
"method": "POST",
"header": [
@@ -464,10 +969,10 @@
],
"body": {
"mode": "raw",
- "raw": "{\r\n \"l10n\":[\r\n {\r\n \"locale\":\"en-US\",\r\n \"slug\":\"shop-catalog-item-05\",\r\n \"description\": \"\",\r\n \"title\":\"Shop item title\",\r\n \"shortText\":\"Lorem ipsum, dolor sit amet consectetur adipisicing elit. Eaque fugit ratione dicta mollitia. Officiis ad...\",\r\n \"text\":\"\",\r\n \"contentType\": \"HTML\",\r\n \"badges\":[\r\n \"sale\"\r\n ]\r\n }\r\n ],\r\n \r\n \"tags\":[\r\n \"react\",\r\n \"redux\",\r\n \"webapi\"\r\n ],\r\n \"categories\":[\r\n \"e154e33f-3cc7-468d-bb66-e0390ddb9ae0\"\r\n ],\r\n \"brandName\":\"Mongodb Brand & Name\",\r\n \"rating\":4.5,\r\n \"price\":20,\r\n \"newPrice\":10,\r\n \"quantity\":100\r\n}"
+ "raw": "{\r\n\r\n \"l10n\": [\r\n {\r\n \"locale\": \"en-US\",\r\n \"slug\": \"hello-world\",\r\n \"description\": \"Hello world description\",\r\n \"title\": \"Hello world title\",\r\n \"shortText\": \"Hello world short text\",\r\n \"text\": \"
Hello World
\",\r\n \"contentType\": \"HTML\",\r\n \"badges\": [\r\n \"post\"\r\n ]\r\n }\r\n ],\r\n \"images\": [\r\n {\r\n \"l10n\": [\r\n {\r\n \"locale\": \"en-US\",\r\n \"alt\": \"...\"\r\n },\r\n {\r\n \"locale\": \"it-IT\",\r\n \"alt\": \"...\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"tags\": [\r\n \"privacy\",\r\n \"terms\"\r\n ],\r\n \"categories\": [\r\n \"e154e33f-3cc7-468d-bb66-e0390ddb9ae0\" \r\n ],\r\n \"familyFriendly\": true\r\n}"
},
"url": {
- "raw": "https://localhost:7151/api/ShopItem/404c8232-9048-4519-bfba-6e78dc7005ca/SKU-05",
+ "raw": "https://localhost:7151/api/BlogItem/404c8232-9048-4519-bfba-6e78dc7005ca",
"protocol": "https",
"host": [
"localhost"
@@ -475,16 +980,15 @@
"port": "7151",
"path": [
"api",
- "ShopItem",
- "404c8232-9048-4519-bfba-6e78dc7005ca",
- "SKU-05"
+ "BlogItem",
+ "404c8232-9048-4519-bfba-6e78dc7005ca"
]
}
},
"response": []
},
{
- "name": "03-Put",
+ "name": "04-Update",
"request": {
"method": "PUT",
"header": [
@@ -501,10 +1005,10 @@
],
"body": {
"mode": "raw",
- "raw": "{\r\n \"slug\":\"shop-catalog-item-05\",\r\n \"l10n\":[\r\n {\r\n \"locale\":\"en-US\",\r\n \"slug\":\"shop-catalog-item-05\",\r\n \"description\": \"\",\r\n \"title\":\"Shop item title\",\r\n \"shortText\":\"Lorem ipsum, dolor sit amet consectetur adipisicing elit. Eaque fugit ratione dicta mollitia. Officiis ad...\",\r\n \"text\":\"\",\r\n \"contentType\": \"HTML\",\r\n \"badges\":[\r\n \"sale\"\r\n ]\r\n }\r\n ],\r\n \"images\":[\r\n {\r\n \"src\":\"https://dummyimage.com/450x300/dee2e6/6c757d.jpg\",\r\n \"l10n\":[\r\n {\r\n \"locale\":\"en-US\",\r\n \"alt\":\"...\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"author\":\"fdc5aa50-ee68-4bae-a8e6-b8ae2c258f60\",\r\n \"tags\":[\r\n \"react\",\r\n \"redux\",\r\n \"webapi\"\r\n ],\r\n \"categories\":[\r\n \"e154e33f-3cc7-468d-bb66-e0390ddb9ae0\"\r\n ],\r\n \"brandName\":\"Mongodb Brand & Name\",\r\n \"rating\":4.5,\r\n \"price\":20,\r\n \"newPrice\":10,\r\n \"quantity\":200\r\n}"
+ "raw": "{\r\n\r\n \"l10n\": [\r\n {\r\n \"locale\": \"en-US\",\r\n \"slug\": \"hello-world\",\r\n \"description\": \"Hello world description\",\r\n \"title\": \"Hello world title\",\r\n \"shortText\": \"Hello world short text\",\r\n \"text\": \"New Hello World
\",\r\n \"contentType\": \"HTML\",\r\n \"badges\": [\r\n \"post\"\r\n ]\r\n }\r\n ],\r\n \"images\": [\r\n {\r\n \"l10n\": [\r\n {\r\n \"locale\": \"en-US\",\r\n \"alt\": \"...\"\r\n },\r\n {\r\n \"locale\": \"it-IT\",\r\n \"alt\": \"...\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"tags\": [\r\n \"privacy\",\r\n \"terms\"\r\n ],\r\n \"categories\": [\r\n \"e154e33f-3cc7-468d-bb66-e0390ddb9ae0\" \r\n ],\r\n \"familyFriendly\": true\r\n}"
},
"url": {
- "raw": "https://localhost:7151/api/ShopItem/404c8232-9048-4519-bfba-6e78dc7005ca/SKU-05",
+ "raw": "https://localhost:7151/api/BlogItem/404c8232-9048-4519-bfba-6e78dc7005ca/94feda90-ddf6-4717-8879-9c7139e7ff30",
"protocol": "https",
"host": [
"localhost"
@@ -512,16 +1016,16 @@
"port": "7151",
"path": [
"api",
- "ShopItem",
+ "BlogItem",
"404c8232-9048-4519-bfba-6e78dc7005ca",
- "SKU-05"
+ "94feda90-ddf6-4717-8879-9c7139e7ff30"
]
}
},
"response": []
},
{
- "name": "04-Delete",
+ "name": "05-Delete",
"request": {
"method": "DELETE",
"header": [
@@ -537,7 +1041,7 @@
}
],
"url": {
- "raw": "https://localhost:7151/api/ShopItem/404c8232-9048-4519-bfba-6e78dc7005ca/SKU-05",
+ "raw": "https://localhost:7151/api/BlogItem/404c8232-9048-4519-bfba-6e78dc7005ca/94feda90-ddf6-4717-8879-9c7139e7ff30",
"protocol": "https",
"host": [
"localhost"
@@ -545,9 +1049,9 @@
"port": "7151",
"path": [
"api",
- "ShopItem",
+ "BlogItem",
"404c8232-9048-4519-bfba-6e78dc7005ca",
- "SKU-05"
+ "94feda90-ddf6-4717-8879-9c7139e7ff30"
]
}
},
@@ -679,301 +1183,6 @@
"response": []
}
]
- },
- {
- "name": "BlogItem",
- "item": [
- {
- "name": "01-Get",
- "request": {
- "method": "GET",
- "header": [
- {
- "key": "Content-Type",
- "value": "application/json",
- "type": "default"
- },
- {
- "key": "Accept",
- "value": "application/json",
- "type": "default"
- }
- ],
- "url": {
- "raw": "https://localhost:7151/api/BlogItem/404c8232-9048-4519-bfba-6e78dc7005ca/11f2f5f8-1270-4640-b082-c2e7ea8e60b4",
- "protocol": "https",
- "host": [
- "localhost"
- ],
- "port": "7151",
- "path": [
- "api",
- "BlogItem",
- "404c8232-9048-4519-bfba-6e78dc7005ca",
- "11f2f5f8-1270-4640-b082-c2e7ea8e60b4"
- ]
- }
- },
- "response": []
- }
- ]
- },
- {
- "name": "CategoryItems",
- "item": [
- {
- "name": "01-Get",
- "request": {
- "method": "GET",
- "header": [
- {
- "key": "Content-Type",
- "value": "application/json",
- "type": "default"
- },
- {
- "key": "Accept",
- "value": "application/json",
- "type": "default"
- }
- ],
- "url": {
- "raw": "https://localhost:7151/api/CategoryItems/404c8232-9048-4519-bfba-6e78dc7005ca?locale=en-US",
- "protocol": "https",
- "host": [
- "localhost"
- ],
- "port": "7151",
- "path": [
- "api",
- "CategoryItems",
- "404c8232-9048-4519-bfba-6e78dc7005ca"
- ],
- "query": [
- {
- "key": "locale",
- "value": "en-US"
- }
- ]
- }
- },
- "response": []
- },
- {
- "name": "01-Get Copy",
- "request": {
- "method": "GET",
- "header": [
- {
- "key": "Content-Type",
- "value": "application/json",
- "type": "default"
- },
- {
- "key": "Accept",
- "value": "application/json",
- "type": "default"
- }
- ],
- "url": {
- "raw": "https://localhost:7151/api/CategoryItems/404c8232-9048-4519-bfba-6e78dc7005ca",
- "protocol": "https",
- "host": [
- "localhost"
- ],
- "port": "7151",
- "path": [
- "api",
- "CategoryItems",
- "404c8232-9048-4519-bfba-6e78dc7005ca"
- ]
- }
- },
- "response": []
- }
- ]
- },
- {
- "name": "CategoryItem",
- "item": [
- {
- "name": "01-Get",
- "request": {
- "method": "GET",
- "header": [
- {
- "key": "Content-Type",
- "value": "application/json",
- "type": "default"
- },
- {
- "key": "Accept",
- "value": "application/json",
- "type": "default"
- }
- ],
- "url": {
- "raw": "https://localhost:7151/api/CategoryItem/404c8232-9048-4519-bfba-6e78dc7005ca/e154e33f-3cc7-468d-bb66-e0390ddb9ae0",
- "protocol": "https",
- "host": [
- "localhost"
- ],
- "port": "7151",
- "path": [
- "api",
- "CategoryItem",
- "404c8232-9048-4519-bfba-6e78dc7005ca",
- "e154e33f-3cc7-468d-bb66-e0390ddb9ae0"
- ]
- }
- },
- "response": []
- },
- {
- "name": "01-GetSlug",
- "request": {
- "method": "GET",
- "header": [
- {
- "key": "Content-Type",
- "value": "application/json",
- "type": "default"
- },
- {
- "key": "Accept",
- "value": "application/json",
- "type": "default"
- }
- ],
- "url": {
- "raw": "https://localhost:7151/api/CategoryItem/404c8232-9048-4519-bfba-6e78dc7005ca?slug=default",
- "protocol": "https",
- "host": [
- "localhost"
- ],
- "port": "7151",
- "path": [
- "api",
- "CategoryItem",
- "404c8232-9048-4519-bfba-6e78dc7005ca"
- ],
- "query": [
- {
- "key": "slug",
- "value": "default"
- }
- ]
- }
- },
- "response": []
- },
- {
- "name": "02-Post",
- "request": {
- "method": "POST",
- "header": [
- {
- "key": "Content-Type",
- "value": "application/json",
- "type": "default"
- },
- {
- "key": "Accept",
- "value": "application/json",
- "type": "default"
- }
- ],
- "body": {
- "mode": "raw",
- "raw": "{\r\n \"l10n\": [\r\n {\r\n \"locale\": \"en-US\",\r\n \"slug\": \"guides\",\r\n \"text\": \"Guides\"\r\n }\r\n ]\r\n}"
- },
- "url": {
- "raw": "https://localhost:7151/api/CategoryItem/404c8232-9048-4519-bfba-6e78dc7005ca",
- "protocol": "https",
- "host": [
- "localhost"
- ],
- "port": "7151",
- "path": [
- "api",
- "CategoryItem",
- "404c8232-9048-4519-bfba-6e78dc7005ca"
- ]
- }
- },
- "response": []
- },
- {
- "name": "03-Put",
- "request": {
- "method": "PUT",
- "header": [
- {
- "key": "Content-Type",
- "value": "application/json",
- "type": "default"
- },
- {
- "key": "Accept",
- "value": "application/json",
- "type": "default"
- }
- ],
- "body": {
- "mode": "raw",
- "raw": "{\r\n \"l10n\": [\r\n {\r\n \"locale\": \"en-US\",\r\n \"slug\": \"guides\",\r\n \"text\": \"Guides\"\r\n },\r\n {\r\n \"locale\": \"it-IT\",\r\n \"slug\": \"guide\",\r\n \"text\": \"Guide\"\r\n }\r\n ]\r\n}"
- },
- "url": {
- "raw": "https://localhost:7151/api/CategoryItem/404c8232-9048-4519-bfba-6e78dc7005ca/2c50f4de-70f2-4414-aabc-7a0d2eb0e203",
- "protocol": "https",
- "host": [
- "localhost"
- ],
- "port": "7151",
- "path": [
- "api",
- "CategoryItem",
- "404c8232-9048-4519-bfba-6e78dc7005ca",
- "2c50f4de-70f2-4414-aabc-7a0d2eb0e203"
- ]
- }
- },
- "response": []
- },
- {
- "name": "04-Delete",
- "request": {
- "method": "DELETE",
- "header": [
- {
- "key": "Content-Type",
- "value": "application/json",
- "type": "default"
- },
- {
- "key": "Accept",
- "value": "application/json",
- "type": "default"
- }
- ],
- "url": {
- "raw": "https://localhost:7151/api/CategoryItem/404c8232-9048-4519-bfba-6e78dc7005ca/2c50f4de-70f2-4414-aabc-7a0d2eb0e203",
- "protocol": "https",
- "host": [
- "localhost"
- ],
- "port": "7151",
- "path": [
- "api",
- "CategoryItem",
- "404c8232-9048-4519-bfba-6e78dc7005ca",
- "2c50f4de-70f2-4414-aabc-7a0d2eb0e203"
- ]
- }
- },
- "response": []
- }
- ]
}
]
}
\ No newline at end of file
diff --git a/webapi/Core/DomainObjects/Documents/BlogItem.cs b/webapi/Core/DomainObjects/Documents/BlogItem.cs
index 68ffcc9..1ed721b 100644
--- a/webapi/Core/DomainObjects/Documents/BlogItem.cs
+++ b/webapi/Core/DomainObjects/Documents/BlogItem.cs
@@ -17,8 +17,11 @@ namespace Core.DomainObjects.Documents {
hash = hash * 23 + Images.Sum(x => x.GetHashCode());
hash = hash * 23 + Author.GetHashCode();
hash = hash * 23 + Created.GetHashCode();
- hash = hash * 23 + Tags.Sum(x => x.GetHashCode());
- hash = hash * 23 + Categories.Sum(x => x.GetHashCode());
+ if(Tags != null)
+ hash = hash * 23 + Tags.Sum(x => x.GetHashCode());
+
+ if(Categories != null)
+ hash = hash * 23 + Categories.Sum(x => x.GetHashCode());
hash = hash * 23 + ReadTime.GetHashCode();
hash = hash * 23 + Likes.GetHashCode();
diff --git a/webapi/DataProviders/CategoryDataProvider.cs b/webapi/DataProviders/CategoryDataProvider.cs
index d6e978f..e69f7a5 100644
--- a/webapi/DataProviders/CategoryDataProvider.cs
+++ b/webapi/DataProviders/CategoryDataProvider.cs
@@ -65,6 +65,6 @@ namespace DataProviders {
DeleteWithPredicate(x => x.Id == id, _collectionName);
public IDomainResult DeleteAll(Guid siteId) =>
- DeleteWithPredicate(x => x.SiteId == siteId, _collectionName);
+ DeleteManyWithPredicate(x => x.SiteId == siteId, _collectionName);
}
}
diff --git a/webapi/DataProviders/ShopCartDataProvider.cs b/webapi/DataProviders/ShopCartDataProvider.cs
index 0c82ed4..c61cd1f 100644
--- a/webapi/DataProviders/ShopCartDataProvider.cs
+++ b/webapi/DataProviders/ShopCartDataProvider.cs
@@ -50,6 +50,6 @@ namespace DataProviders {
DeleteWithPredicate(x => x.Id == id, _collectionName);
public IDomainResult DeleteAll(Guid siteId, Guid userId) =>
- DeleteWithPredicate(x => x.SiteId == siteId && x.UserId == userId, _collectionName);
+ DeleteManyWithPredicate(x => x.SiteId == siteId && x.UserId == userId, _collectionName);
}
}
diff --git a/webapi/Tests/Extensions/IEquatableExtensionsTests.cs b/webapi/Tests/Extensions/IEquatableExtensionsTests.cs
index 1433754..edac496 100644
--- a/webapi/Tests/Extensions/IEquatableExtensionsTests.cs
+++ b/webapi/Tests/Extensions/IEquatableExtensionsTests.cs
@@ -19,7 +19,14 @@ namespace ExtensionsTests {
}
public override int GetHashCode() {
- return Test.GetHashCode();
+ unchecked {
+ int hash = 17;
+
+ if (Test != null)
+ hash = hash * 23 + Test.GetHashCode();
+
+ return hash;
+ }
}
}
diff --git a/webapi/Tests/Extensions/ObjectExtensionsTests.cs b/webapi/Tests/Extensions/ObjectExtensionsTests.cs
index 42128d4..bec3ef4 100644
--- a/webapi/Tests/Extensions/ObjectExtensionsTests.cs
+++ b/webapi/Tests/Extensions/ObjectExtensionsTests.cs
@@ -7,7 +7,7 @@ namespace ExtensionsTests {
public class ObjectExtensions {
private class DummyClass {
- public string Test { get; set; }
+ public string? Test { get; set; }
}
[Fact]
diff --git a/webapi/Tests/Extensions/StringExtensionsTests.cs b/webapi/Tests/Extensions/StringExtensionsTests.cs
index a47b482..a1ed30d 100644
--- a/webapi/Tests/Extensions/StringExtensionsTests.cs
+++ b/webapi/Tests/Extensions/StringExtensionsTests.cs
@@ -17,12 +17,12 @@ using System.Threading.Tasks;
namespace ExtensionsTests {
public class StringExtensions : ServicesBase {
- private readonly Configuration _configuration;
+ // private readonly Configuration _configuration;
- public StringExtensions() {
- _configuration = ServiceProvider.GetService>()?.Value
- ?? throw new NullReferenceException("Configuration not found");
- }
+ // public StringExtensions() {
+ // _configuration = ServiceProvider.GetService>()?.Value
+ // ?? throw new NullReferenceException("Configuration not found");
+ // }
[Fact]
@@ -93,7 +93,7 @@ namespace ExtensionsTests {
[Fact]
public void ToNullableInt() {
var value = "0".ToNullableInt();
- Assert.True(value.GetType() == typeof(int) && value == 0 && "".ToNullableInt() == null);
+ Assert.True(value != null && value.GetType() == typeof(int?) && value == 0 && "".ToNullableInt() == null);
}
[Fact]
@@ -105,7 +105,7 @@ namespace ExtensionsTests {
[Fact]
public void ToNullableUint() {
var value = "0".ToNullableUint();
- Assert.True(value.GetType() == typeof(uint) && value == 0 && "".ToNullableUint() == null);
+ Assert.True(value != null && value.GetType() == typeof(uint) && value == 0 && "".ToNullableUint() == null);
}
[Fact]
@@ -117,7 +117,7 @@ namespace ExtensionsTests {
[Fact]
public void ToNullableDecimal() {
var value = "0".ToNullableDecimal();
- Assert.True(value.GetType() == typeof(decimal) && "".ToNullableDecimal() == null);
+ Assert.True(value != null && value.GetType() == typeof(decimal) && "".ToNullableDecimal() == null);
}
[Fact]
@@ -129,7 +129,7 @@ namespace ExtensionsTests {
[Fact]
public void ToNullableDouble() {
var value = "0".ToNullableDouble();
- Assert.True(value.GetType() == typeof(double) && value == 0 && "".ToNullableDouble() == null);
+ Assert.True(value != null && value.GetType() == typeof(double) && value == 0 && "".ToNullableDouble() == null);
}
[Fact]
@@ -163,7 +163,12 @@ namespace ExtensionsTests {
[Fact]
public void ToNullalbeBool() {
- Assert.True("true".ToNullableBool().Value && !"false".ToNullableBool().Value && "".ToNullableBool() == null);
+ var trueTest = "true".ToNullableBool();
+ var falseTest = "false".ToNullableBool();
+ if (trueTest == null || falseTest == null)
+ Assert.False(true);
+ else
+ Assert.True(trueTest.Value && !falseTest.Value && "".ToNullableBool() == null);
}
[Fact]
@@ -195,13 +200,17 @@ namespace ExtensionsTests {
public void Excerpt() => Assert.Equal("M...", "MAKS-IT".Excerpt(4));
private class DummyClass {
- public string Test { get; set; }
+ public string? Test { get; set; }
}
[Fact]
public void ToObject() {
var obj = "{ \"Test\": \"Test\" }".ToObject();
- Assert.Equal("Test", obj.Test);
+
+ if (obj == null)
+ Assert.False(true);
+ else
+ Assert.Equal("Test", obj.Test);
}
public static IEnumerable