diff --git a/.gitignore b/.gitignore index bf90d6b..c5f95eb 100644 --- a/.gitignore +++ b/.gitignore @@ -109,4 +109,4 @@ temp/ # Public directory public -mvc/models/products.json \ No newline at end of file +mvc/models/data/ \ No newline at end of file diff --git a/README.md b/README.md index dcd573b..03d4c9b 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ A small app to check how old my tech products I own are. ## Setup - Clone this repo. -- Create a JSON file at `mvc/models/products.json` with an array of products as such: +- Create a JSON file at `mvc/models/data/products.json` with an array of products as such: ```json [ diff --git a/mvc/models/products.js b/mvc/models/products.js index a60f0be..ff80d68 100644 --- a/mvc/models/products.js +++ b/mvc/models/products.js @@ -1,7 +1,7 @@ const dayjs = require("dayjs"); function getProducts() { - let products = require("./products.json"); + let products = require("./data/products.json"); products = products.sort((a, b) => { return dayjs(a.purchaseDate).diff(dayjs(b.purchaseDate));