Skip to content

Commit

Permalink
Issue SevenSpikes#6 - Changed the order items routes to be just items…
Browse files Browse the repository at this point in the history
… i.e api/orders/{orderId}/order_items is now just api/orders/{orderId}/items
  • Loading branch information
poyker committed Dec 20, 2016
1 parent 28f1f4b commit f74f652
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Nop.Plugin.Api/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -296,43 +296,43 @@ private void ConfigureWebApi(IAppBuilder app)

config.Routes.MapHttpRoute(
name: "orderItemsByOrderId",
routeTemplate: "api/orders/{orderId}/order_items",
routeTemplate: "api/orders/{orderId}/items",
defaults: new { controller = "OrderItems", action = "GetOrderItems" },
constraints: new { httpMethod = new HttpMethodConstraint(HttpMethod.Get) });

config.Routes.MapHttpRoute(
name: "orderItemByIdForOrder",
routeTemplate: "api/orders/{orderId}/order_items/{orderItemId}",
routeTemplate: "api/orders/{orderId}/items/{orderItemId}",
defaults: new { controller = "OrderItems", action = "GetOrderItemByIdForOrder" },
constraints: new { httpMethod = new HttpMethodConstraint(HttpMethod.Get) });

config.Routes.MapHttpRoute(
name: "orderItemsCountByOrderId",
routeTemplate: "api/orders/{orderId}/order_items/count",
routeTemplate: "api/orders/{orderId}/items/count",
defaults: new { controller = "OrderItems", action = "GetOrderItemsCount" },
constraints: new { httpMethod = new HttpMethodConstraint(HttpMethod.Get) });

config.Routes.MapHttpRoute(
name: "CreateOrderItem",
routeTemplate: "api/orders/{orderId}/order_items",
routeTemplate: "api/orders/{orderId}/items",
defaults: new { controller = "OrderItems", action = "CreateOrderItem" },
constraints: new { httpMethod = new HttpMethodConstraint(HttpMethod.Post) });

config.Routes.MapHttpRoute(
name: "UpdateOrderItem",
routeTemplate: "api/orders/{orderId}/order_items/{orderItemId}",
routeTemplate: "api/orders/{orderId}/items/{orderItemId}",
defaults: new { controller = "OrderItems", action = "UpdateOrderItem" },
constraints: new { httpMethod = new HttpMethodConstraint(HttpMethod.Put) });

config.Routes.MapHttpRoute(
name: "deleteOrderItemForOrderById",
routeTemplate: "api/orders/{orderId}/order_items/{orderItemId}",
routeTemplate: "api/orders/{orderId}/items/{orderItemId}",
defaults: new { controller = "OrderItems", action = "DeleteOrderItemById" },
constraints: new { httpMethod = new HttpMethodConstraint(HttpMethod.Delete) });

config.Routes.MapHttpRoute(
name: "deleteOrderItemsForOrder",
routeTemplate: "api/orders/{orderId}/order_items",
routeTemplate: "api/orders/{orderId}/items",
defaults: new { controller = "OrderItems", action = "DeleteAllOrderItemsForOrder" },
constraints: new { httpMethod = new HttpMethodConstraint(HttpMethod.Delete) });

Expand Down

0 comments on commit f74f652

Please sign in to comment.