From 7381a7033231e6454a37fd64b1f3de4e8d59355f Mon Sep 17 00:00:00 2001 From: "Adam T. Carpenter" Date: Wed, 11 Nov 2020 20:07:12 -0500 Subject: Kind of flailing with the UI; lots of API bugfixes though. --- iridescence/package.json | 2 +- iridescence/src/App.vue | 4 +- iridescence/src/api/dichroism.js | 18 +- iridescence/src/components/Navbar.vue | 13 +- iridescence/src/components/admin/NewProduct.vue | 12 +- .../src/components/admin/ProductEditCard.vue | 73 +- .../src/components/admin/ProductEditList.vue | 2 +- iridescence/src/models/product.js | 62 +- iridescence/src/models/product_diff.js | 43 + iridescence/src/store/index.js | 33 +- iridescence/src/views/Admin.vue | 11 +- iridescence/yarn.lock | 1756 ++++++++++---------- 12 files changed, 1049 insertions(+), 980 deletions(-) create mode 100644 iridescence/src/models/product_diff.js (limited to 'iridescence') diff --git a/iridescence/package.json b/iridescence/package.json index ab8e4f0..cc8fd53 100644 --- a/iridescence/package.json +++ b/iridescence/package.json @@ -9,7 +9,6 @@ }, "dependencies": { "animate.css": "^4.1.1", - "bulma": "^0.9.0", "core-js": "^3.6.5", "vue": "^2.6.11", "vue-router": "^3.2.0", @@ -23,6 +22,7 @@ "@vue/cli-service": "~4.5.0", "@vue/eslint-config-prettier": "^6.0.0", "babel-eslint": "^10.1.0", + "bulma": "^0.9.1", "eslint": "^6.7.2", "eslint-plugin-prettier": "^3.1.3", "eslint-plugin-vue": "^6.2.2", diff --git a/iridescence/src/App.vue b/iridescence/src/App.vue index a586f83..debc599 100644 --- a/iridescence/src/App.vue +++ b/iridescence/src/App.vue @@ -29,5 +29,7 @@ export default { diff --git a/iridescence/src/api/dichroism.js b/iridescence/src/api/dichroism.js index 610941c..c2cc93c 100644 --- a/iridescence/src/api/dichroism.js +++ b/iridescence/src/api/dichroism.js @@ -18,7 +18,7 @@ export default class Dichroism { const photos = await this._sendRequest("photos", options); return photos.map(p => new PhotoSet(p)); } catch (err) { - console.error(err.message); + console.error("Dichroism: " + err.message); return null; } } @@ -28,7 +28,7 @@ export default class Dichroism { const products = await this._sendRequest("products", null); return products.map(p => new Product(p)); } catch (err) { - console.error(err.message); + console.error("Dichroism: " + err.message); return []; } } @@ -36,14 +36,17 @@ export default class Dichroism { async updateProduct(fieldDiff) { const options = { method: "PATCH", - body: fieldDiff + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(fieldDiff) }; try { const product = await this._sendRequest("products", options); return new Product(product); } catch (err) { - console.error(err.message); + console.error("Dichroism: " + err.message); return null; } } @@ -51,14 +54,17 @@ export default class Dichroism { async createProduct(newProduct) { const options = { method: "POST", - body: newProduct + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(newProduct) }; try { const product = await this._sendRequest("products", options); return new Product(product); } catch (err) { - console.error(err.message); + console.error("Dichroism: " + err.message); return null; } } diff --git a/iridescence/src/components/Navbar.vue b/iridescence/src/components/Navbar.vue index 0a66fa8..78627e9 100644 --- a/iridescence/src/components/Navbar.vue +++ b/iridescence/src/components/Navbar.vue @@ -36,14 +36,9 @@ > -