From 297f2da72a3364f43f523b19f7d13493aa852c9b Mon Sep 17 00:00:00 2001 From: JaberHPranto Date: Sun, 10 Oct 2021 19:15:46 +0600 Subject: [PATCH] update blogs --- client/package-lock.json | 85 ----------------------- client/package.json | 1 - client/src/components/Blog/BlogDetails.js | 2 +- client/src/components/Blog/NewBlog.js | 3 +- server/routes/uploadRoutes.js | 4 +- 5 files changed, 4 insertions(+), 91 deletions(-) diff --git a/client/package-lock.json b/client/package-lock.json index b3b54c5..0a2c6b0 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -2517,14 +2517,6 @@ "resolved": "https://registry.npmjs.org/@types/q/-/q-1.5.4.tgz", "integrity": "sha512-1HcDas8SEj4z1Wc696tH56G8OlRaH/sqZOynNNB+HF0WOeXPaxTtbYzJY2oEfiUxjSKjhCKr+MvR7dCHcEelug==" }, - "@types/quill": { - "version": "1.3.10", - "resolved": "https://registry.npmjs.org/@types/quill/-/quill-1.3.10.tgz", - "integrity": "sha512-IhW3fPW+bkt9MLNlycw8u8fWb7oO7W5URC9MfZYHBlA24rex9rs23D5DETChu1zvgVdc5ka64ICjJOgQMr6Shw==", - "requires": { - "parchment": "^1.1.2" - } - }, "@types/react": { "version": "17.0.11", "resolved": "https://registry.npmjs.org/@types/react/-/react-17.0.11.tgz", @@ -4280,11 +4272,6 @@ "wrap-ansi": "^6.2.0" } }, - "clone": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", - "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=" - }, "clsx": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/clsx/-/clsx-1.1.1.tgz", @@ -4738,15 +4725,6 @@ "sha.js": "^2.4.8" } }, - "create-react-class": { - "version": "15.7.0", - "resolved": "https://registry.npmjs.org/create-react-class/-/create-react-class-15.7.0.tgz", - "integrity": "sha512-QZv4sFWG9S5RUvkTYWbflxeZX+JG7Cz0Tn33rQBJ+WFQTqTfUTjMjiv9tnfXazjsO5r0KhPs+AqCjyrQX6h2ng==", - "requires": { - "loose-envify": "^1.3.1", - "object-assign": "^4.1.1" - } - }, "cross-spawn": { "version": "6.0.5", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", @@ -6495,11 +6473,6 @@ } } }, - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" - }, "extend-shallow": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", @@ -6583,11 +6556,6 @@ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" }, - "fast-diff": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.1.2.tgz", - "integrity": "sha512-KaJUt+M9t1qaIteSvjc6P3RbMdXsNhK61GRftR6SNxqmhthcd9MGIi4T+o0jD8LUSpSnSKXE20nLtJ3fOHxQig==" - }, "fast-glob": { "version": "3.2.5", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.5.tgz", @@ -10177,11 +10145,6 @@ } } }, - "parchment": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/parchment/-/parchment-1.1.4.tgz", - "integrity": "sha512-J5FBQt/pM2inLzg4hEWmzQx/8h8D0CiDxaG3vyp9rKrQRSDgBlhjdP5jQGgosEajXPSQouXGHOmVdgo7QmJuOg==" - }, "parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -11684,36 +11647,6 @@ "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==" }, - "quill": { - "version": "1.3.7", - "resolved": "https://registry.npmjs.org/quill/-/quill-1.3.7.tgz", - "integrity": "sha512-hG/DVzh/TiknWtE6QmWAF/pxoZKYxfe3J/d/+ShUWkDvvkZQVTPeVmUJVu1uE6DDooC4fWTiCLh84ul89oNz5g==", - "requires": { - "clone": "^2.1.1", - "deep-equal": "^1.0.1", - "eventemitter3": "^2.0.3", - "extend": "^3.0.2", - "parchment": "^1.1.4", - "quill-delta": "^3.6.2" - }, - "dependencies": { - "eventemitter3": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-2.0.3.tgz", - "integrity": "sha1-teEHm1n7XhuidxwKmTvgYKWMmbo=" - } - } - }, - "quill-delta": { - "version": "3.6.3", - "resolved": "https://registry.npmjs.org/quill-delta/-/quill-delta-3.6.3.tgz", - "integrity": "sha512-wdIGBlcX13tCHOXGMVnnTVFtGRLoP0imqxM696fIPwIf5ODIYUHIvHbZcyvGlZFiFhK5XzDC2lpjbxRhnM05Tg==", - "requires": { - "deep-equal": "^1.0.1", - "extend": "^3.0.2", - "fast-diff": "1.1.2" - } - }, "raf": { "version": "3.4.1", "resolved": "https://registry.npmjs.org/raf/-/raf-3.4.1.tgz", @@ -11967,11 +11900,6 @@ "scheduler": "^0.20.2" } }, - "react-dom-factories": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/react-dom-factories/-/react-dom-factories-1.0.2.tgz", - "integrity": "sha1-63cFxNs2+1AbOqOP91lhaqD/luA=" - }, "react-error-overlay": { "version": "6.0.9", "resolved": "https://registry.npmjs.org/react-error-overlay/-/react-error-overlay-6.0.9.tgz", @@ -12067,19 +11995,6 @@ } } }, - "react-quill": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/react-quill/-/react-quill-1.3.5.tgz", - "integrity": "sha512-/W/rNCW+6QpGz8yQ9tFK5Ka/h/No1RqrcOOvCIOR092OiKzRFlU2xbPEwiP3Wgy/Dx13pi1YhjReDMX/5uotJg==", - "requires": { - "@types/quill": "1.3.10", - "create-react-class": "^15.6.0", - "lodash": "^4.17.4", - "prop-types": "^15.5.10", - "quill": "^1.3.7", - "react-dom-factories": "^1.0.0" - } - }, "react-redux": { "version": "7.2.4", "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-7.2.4.tgz", diff --git a/client/package.json b/client/package.json index 3fddb9a..7c2db69 100644 --- a/client/package.json +++ b/client/package.json @@ -18,7 +18,6 @@ "react-dom": "^17.0.2", "react-google-login": "^5.2.2", "react-html-parser": "^2.0.2", - "react-quill": "^1.3.5", "react-redux": "^7.2.4", "react-router-bootstrap": "^0.25.0", "react-router-dom": "^5.2.0", diff --git a/client/src/components/Blog/BlogDetails.js b/client/src/components/Blog/BlogDetails.js index e42a29e..2a988d8 100644 --- a/client/src/components/Blog/BlogDetails.js +++ b/client/src/components/Blog/BlogDetails.js @@ -3,7 +3,7 @@ import { Badge, Container } from 'react-bootstrap' import ReactHtmlParser from 'react-html-parser' import { useDispatch, useSelector } from 'react-redux' import { fetchBlogById } from '../../redux/actions/blogActions' -import '../../styles/bl2og.css' +import '../../styles/blog.css' import Loader from '../Ecommerce/Loader' import Message from '../Ecommerce/Message' diff --git a/client/src/components/Blog/NewBlog.js b/client/src/components/Blog/NewBlog.js index 30d4245..ae53079 100644 --- a/client/src/components/Blog/NewBlog.js +++ b/client/src/components/Blog/NewBlog.js @@ -14,7 +14,6 @@ function NewBlog() { const dispatch = useDispatch() const [title, setTitle] = useState("") - const [description, setDescription] = useState("") const [category, setCategory] = useState("") const [tags, setTags] = useState("") const [image, setImage] = useState("") @@ -62,7 +61,7 @@ function NewBlog() { const clearInputs = () => { setTitle("") - setDescription("") + setContent("") setTags("") setCategory("") setImage("") diff --git a/server/routes/uploadRoutes.js b/server/routes/uploadRoutes.js index b3cbb54..a5389c7 100644 --- a/server/routes/uploadRoutes.js +++ b/server/routes/uploadRoutes.js @@ -50,13 +50,13 @@ router.post('/', upload.single('image'), async (req, res) => { } }) -router.post('/ck-image', multipartMiddleware, function(req, res) { +router.post('/ck-image', multipartMiddleware, async function(req, res) { const tempFile = req.files.upload.path - console.log(req.files); try { res.status(200).json({ uploaded: true, url: `${hostUrl}/${tempFile}` + }) } catch (err) { console.log(err);