From b22490ed153b2c58e275efcd7fcb0c1f6ad6d313 Mon Sep 17 00:00:00 2001 From: Samantha Grieco Date: Sat, 26 Nov 2022 21:08:10 -0500 Subject: [PATCH] added blog seed link and fixed console errors --- src/backend/seeds/10_blog.js | 8 ++++---- src/frontend/pages/blogs/BlogPage.js | 4 ++-- src/frontend/pages/blogs/edit-a-blog/EditBlog.js | 15 ++++++++------- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/backend/seeds/10_blog.js b/src/backend/seeds/10_blog.js index b876c33..2e86227 100644 --- a/src/backend/seeds/10_blog.js +++ b/src/backend/seeds/10_blog.js @@ -14,7 +14,7 @@ if (!ENV_IS_STAGING_OR_PROD) { summary: 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptas accusantium dolorem, beatae possimus nesciunt ab? Illum atque doloremque fugit ipsam quibusdam eveniet magnam quod', date: '23-May-2021', - link: 'string', + link: 'https://example.com/', image: 'https://storage.googleapis.com/waterloop_cms_image_upload/1614225359133-waterloop1.png', closed: true, category: 'Media Appearance', @@ -26,7 +26,7 @@ if (!ENV_IS_STAGING_OR_PROD) { summary: 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptas accusantium dolorem, beatae possimus nesciunt ab? Illum atque doloremque fugit ipsam quibusdam eveniet magnam quod', date: '20-May-2021', - link: 'string', + link: 'https://example.com/', image: 'https://storage.googleapis.com/waterloop_cms_image_upload/1614225359139-waterloop2.png', closed: false, category: 'Blog', @@ -38,7 +38,7 @@ if (!ENV_IS_STAGING_OR_PROD) { summary: 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptas accusantium dolorem, beatae possimus nesciunt ab? Illum atque doloremque fugit ipsam quibusdam eveniet magnam quod', date: '10-May-2021', - link: 'string', + link: 'https://example.com/', image: 'https://storage.googleapis.com/waterloop_cms_image_upload/1614226228513-waterloop1.png', closed: false, category: 'Media Appearance', @@ -50,7 +50,7 @@ if (!ENV_IS_STAGING_OR_PROD) { summary: 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptas accusantium dolorem, beatae possimus nesciunt ab? Illum atque doloremque fugit ipsam quibusdam eveniet magnam quod', date: '1-May-2021', - link: 'string', + link: 'https://example.com/', image: 'https://storage.googleapis.com/waterloop_cms_image_upload/1614482400810-waterloop2.png', closed: true, category: 'Blog', diff --git a/src/frontend/pages/blogs/BlogPage.js b/src/frontend/pages/blogs/BlogPage.js index 7058c9a..45741ec 100644 --- a/src/frontend/pages/blogs/BlogPage.js +++ b/src/frontend/pages/blogs/BlogPage.js @@ -44,15 +44,15 @@ const headers = [ {id: 'title', value: 'Title'}, {id: 'updatedAt', value: 'Date'}, {id: 'author', value: 'Author'}, + {id: 'category', value: 'Category'}, {id: 'visibility', value: 'Visibility'}, - {id: 'category', value: 'Category'} ]; const RowComponent = ({ title, updatedAt, author, link, category, visibility}) => ( <> - {title} + {title} {updatedAt} diff --git a/src/frontend/pages/blogs/edit-a-blog/EditBlog.js b/src/frontend/pages/blogs/edit-a-blog/EditBlog.js index 234c5c9..03fa8aa 100644 --- a/src/frontend/pages/blogs/edit-a-blog/EditBlog.js +++ b/src/frontend/pages/blogs/edit-a-blog/EditBlog.js @@ -117,7 +117,7 @@ const EditBlog = ({ add }) => { } = useBlogForm(); const displayImages = useMemo(() => { - return [ + return (
{currentImageURL != '' && @@ -140,7 +140,7 @@ const EditBlog = ({ add }) => { }
- ]; + ); }, [currentImageURL, uploadedImageURL]); @@ -148,7 +148,7 @@ const EditBlog = ({ add }) => { return [ ...errors.map((error, index) => { return ( - + {`${index+1}. `}{error} ); @@ -268,11 +268,12 @@ const EditBlog = ({ add }) => { - {(errors.length > 0) && - - Errors: + {(errors.length > 0) && + <> + Errors: {errorList} - } + + }