diff --git a/.eslintrc.json b/.eslintrc.json index 606da72..d7f2717 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -16,7 +16,8 @@ "eol-last": "off", "import/extensions": [ 1, { "js": "always", "json": "always" - }] + }], + "import/no-cycle": 0 }, "ignorePatterns": [ "dist/", diff --git a/src/apis/food.js b/src/apis/food.js index 9252cd5..cf80484 100644 --- a/src/apis/food.js +++ b/src/apis/food.js @@ -1,7 +1,8 @@ /* eslint-disable import/no-cycle */ import paginate from '../index.js'; -let meals = []; +/* eslint-disable-next-line */ +export let meals = []; let currentPosts = []; let currentPage = 1; const postsPerPage = 10; diff --git a/src/apis/index.js b/src/apis/index.js deleted file mode 100644 index e69de29..0000000 diff --git a/src/apis/requests.js b/src/apis/requests.js new file mode 100644 index 0000000..2d31db7 --- /dev/null +++ b/src/apis/requests.js @@ -0,0 +1,34 @@ +/* eslint-disable consistent-return */ +export const postComment = async (post) => { + try { + await fetch( + 'https://us-central1-involvement-api.cloudfunctions.net/capstoneApi/apps/XkZb08sfqWimSB3Sqtb3/comments', + { + method: 'POST', + body: JSON.stringify(post), + headers: { + 'Content-type': 'application/json; charset=UTF-8', + }, + }, + ); + } catch (err) { + // console.error(err); + } +}; + +export const getComment = async (id) => { + try { + const response = await fetch( + `https://us-central1-involvement-api.cloudfunctions.net/capstoneApi/apps/ofEMqPseJBxt6GrJYVpl/comments?item_id=${id}`, + { + method: 'GET', + headers: { + 'Content-type': 'application/json; charset=UTF-8', + }, + }, + ); + return await response.json(); + } catch (err) { + // console.log(err) + } +}; diff --git a/src/base.css b/src/base.css index 15a0877..640b467 100644 --- a/src/base.css +++ b/src/base.css @@ -1241,7 +1241,7 @@ Ensure the default browser behavior of the `hidden` attribute. } .md\:max-w-full { - max-width: 100%; + max-width: 60%; } .md\:flex-row { diff --git a/src/compnents.js b/src/compnents.js deleted file mode 100644 index e69de29..0000000 diff --git a/src/index.html b/src/index.html index ef834dd..6e0dda8 100644 --- a/src/index.html +++ b/src/index.html @@ -84,6 +84,9 @@
+ + +