From bcf2639b71e6a27dbbaaab19d5547a4d43b9a980 Mon Sep 17 00:00:00 2001 From: Paul Yu Date: Sun, 22 Oct 2023 11:15:57 -0700 Subject: [PATCH] refactor: product renaming --- src/product-service/src/main.rs | 10 +++++----- src/store-admin/README.md | 7 +++---- src/store-admin/src/components/TopNav.vue | 2 +- src/store-front/src/components/TopNav.vue | 2 +- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/product-service/src/main.rs b/src/product-service/src/main.rs index 5153c601..978a663f 100644 --- a/src/product-service/src/main.rs +++ b/src/product-service/src/main.rs @@ -39,7 +39,7 @@ async fn add_product( mut payload: web::Payload, ) -> Result { let mut products = data.products.lock().unwrap(); - let new_id = products.len() as i32 + 2; + let new_id = products.len() as i32 + 1; // payload is a stream of Bytes objects let mut body = web::BytesMut::new(); @@ -114,9 +114,9 @@ async fn main() -> std::io::Result<()> { let products = vec![ Product { id: 1, - name: "Captain Catnip's Fisherman's Friend".to_string(), + name: "Contoso Catnip's Friend".to_string(), price: 9.99, - description: "Watch your feline friend embark on a fishing adventure with Captain Catnip's Fisherman's Friend toy. Packed with irresistible catnip and dangling fish lure.".to_string(), + description: "Watch your feline friend embark on a fishing adventure with Contoso Catnip's Friend toy. Packed with irresistible catnip and dangling fish lure.".to_string(), image: "/placeholder.png".to_string() }, Product { @@ -170,9 +170,9 @@ async fn main() -> std::io::Result<()> { }, Product { id: 9, - name: "Captain Claw's Crab Cat Toy".to_string(), + name: "Contoso Claw's Crabby Cat Toy".to_string(), price: 3.99, - description: "Watch your cat go crazy for Captain Claw's Crab Cat Toy. This crinkly and catnip-filled toy will awaken their hunting instincts and provide endless entertainment.".to_string(), + description: "Watch your cat go crazy for Contoso Claw's Crabby Cat Toy. This crinkly and catnip-filled toy will awaken their hunting instincts and provide endless entertainment.".to_string(), image: "/placeholder.png".to_string() }, Product { diff --git a/src/store-admin/README.md b/src/store-admin/README.md index 56c659d7..cc60b1e8 100644 --- a/src/store-admin/README.md +++ b/src/store-admin/README.md @@ -16,10 +16,9 @@ This is a Vue.js app that simulates a store admin portal where users can manuall The app relies on the [product-service](../product-service), [makeline-service](../order-service), and optionally the [ai-service](../ai-service) along with mongodb and rabbitmq instances running. A docker-compose file is provided to make this easy. -To run the necessary services, clone the repo, open a terminal, and navigate to the `store-admin` directory. +To run the necessary services, clone the repo, open a terminal, and navigate to the `store-admin` directory. - -If you have access to OpenAI or Azure OpenAI, open the `docker-compose.yml` file, uncomment the `aiservices` block, and add your OpenAI or Azure OpenAI credentials. +If you have access to OpenAI or Azure OpenAI, open the `docker-compose.yml` file, uncomment the `aiservices` block, and add your OpenAI or Azure OpenAI credentials. > IMPORTANT: When filling in the values, do not put the value in double-quotes. @@ -38,7 +37,7 @@ Then run the following command: docker compose up ``` -With the services running, open a new terminal and navigate to the `store-front` directory. Then run the following commands: +With the services running, open a new terminal and navigate to the `store-admin` directory. Then run the following commands: ```bash export VUE_APP_PRODUCT_SERVICE_URL=http://localhost:3002/ diff --git a/src/store-admin/src/components/TopNav.vue b/src/store-admin/src/components/TopNav.vue index a6fd94ae..02dbaf54 100644 --- a/src/store-admin/src/components/TopNav.vue +++ b/src/store-admin/src/components/TopNav.vue @@ -1,7 +1,7 @@