diff --git a/package-lock.json b/package-lock.json index 48607b6..19bfeec 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,11 @@ "@mui/styled-engine-sc": "^6.0.0-alpha.9", "@mui/x-date-pickers": "^6.18.6", "axios": "^1.6.2", +<<<<<<< Updated upstream "dayjs": "^1.11.10", +======= + "js-cookie": "^3.0.5", +>>>>>>> Stashed changes "react": "^18.2.0", "react-dom": "^18.2.0", "react-router-dom": "^6.21.1", @@ -3657,6 +3661,14 @@ "set-function-name": "^2.0.1" } }, + "node_modules/js-cookie": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/js-cookie/-/js-cookie-3.0.5.tgz", + "integrity": "sha512-cEiJEAEoIbWfCZYKWhVwFuvPX1gETRYPw6LlaTKoxD3s2AkXzkCjnp6h0V77ozyqj0jakteJ4YqDJT830+lVGw==", + "engines": { + "node": ">=14" + } + }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", diff --git a/package.json b/package.json index b50298d..2d7e576 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,11 @@ "@mui/styled-engine-sc": "^6.0.0-alpha.9", "@mui/x-date-pickers": "^6.18.6", "axios": "^1.6.2", +<<<<<<< Updated upstream "dayjs": "^1.11.10", +======= + "js-cookie": "^3.0.5", +>>>>>>> Stashed changes "react": "^18.2.0", "react-dom": "^18.2.0", "react-router-dom": "^6.21.1", diff --git a/src/Components/HomePage/index.jsx b/src/Components/HomePage/index.jsx index dd951bf..432620d 100644 --- a/src/Components/HomePage/index.jsx +++ b/src/Components/HomePage/index.jsx @@ -1,10 +1,13 @@ import Header from "../Header"; import styles from "./style.module.scss"; import TableMeets from '../TableMeets/TableMeets' -import Home from "../Home/Home"; -// import FetchUtils from "../utils/FetchUtils"; -import EditForm from "../edit/EditForm"; -import PostForm from "../post/PostForm"; +// import EditForm from "../edit/EditMeetsForm"; +import PostForm from "../post/Meets"; +import Users from "../post/Users"; +// import User from "../get/User"; +import Questions from "../post/Questions"; +import { GetQuestions } from "../get/Questions"; + const APIURL = '' @@ -66,10 +69,16 @@ const HomePage = () => {
- + {/* */} + {/* */} {/* */} {/* */} {/* */} + {/* */} + {/* */} + {/* */} + + diff --git a/src/Components/MeetPage/index.jsx b/src/Components/MeetPage/index.jsx index 0f8c48d..33d2e21 100644 --- a/src/Components/MeetPage/index.jsx +++ b/src/Components/MeetPage/index.jsx @@ -3,10 +3,9 @@ import styles from './style.module.scss'; import clock from '../../img/MeetPage/Clock.png'; import globe from '../../img/MeetPage/Globe.png'; import avatar from '../../img/MeetPage/avatar.png'; -// import { HttpApiMethods } from '../utils/FetchUtils.jsx'; import {useState} from 'react' import { style } from "@mui/system"; -import Card from "../Card"; +// import Card from "../Card"; import Grid from '@mui/material/Grid'; import Box from '@mui/material/Box'; diff --git a/src/components/Home/Home.jsx b/src/components/Home/Home.jsx index 7c9aeb2..5c35c85 100644 --- a/src/components/Home/Home.jsx +++ b/src/components/Home/Home.jsx @@ -1,71 +1,71 @@ -import React from 'react'; -import './style.css' -import styled from 'styled-components'; -import { HttpApiMethods } from '../utils/FetchUtils'; -import {useState} from 'react' -import EditForm from '../post/PostForm'; -import Grid from '@mui/material/Grid'; -import Card from '../Card'; -import Box from '@mui/material/Box'; +// import React from 'react'; +// import './style.css' +// import styled from 'styled-components'; +// // import { HttpApiMethods } from '../utils/FetchUtils'; +// import {useState} from 'react' +// import EditForm from '../post/Meets'; +// import Grid from '@mui/material/Grid'; +// import Card from '../Card'; +// import Box from '@mui/material/Box'; -function extractDateTime(dateString) { - const dateTime = new Date(dateString); - const date = dateTime.toLocaleDateString(); - const time = dateTime.toLocaleTimeString(); +// function extractDateTime(dateString) { +// const dateTime = new Date(dateString); +// const date = dateTime.toLocaleDateString(); +// const time = dateTime.toLocaleTimeString(); - return { date, time }; -} +// return { date, time }; +// } -const httpApiMethods = new HttpApiMethods() +// const httpApiMethods = new HttpApiMethods() -const meets = await httpApiMethods.GetMeetings() +// const meets = await httpApiMethods.GetMeetings() -const Home = () => { - const [count, setCount] = useState(7) +// const Home = () => { +// const [count, setCount] = useState(7) - const filterMeet = meets.filter( (item, index) => index <= count ) - const allMeets = () => { - setCount(meets.length) - } - return ( - <> - - +// const filterMeet = meets.filter( (item, index) => index <= count ) +// const allMeets = () => { +// setCount(meets.length) +// } +// return ( +// <> +// +// - {Array.isArray(meets) ? ( - filterMeet.map((item, index) => ( +// {Array.isArray(meets) ? ( +// filterMeet.map((item, index) => ( - -
-
{item.speackerImage}
-
-
{item.tags}
-
{item.type}
-
-

{item.title}

-

{extractDateTime(item.time).date}, в {extractDateTime(item.time).time} по Московскому времени

-
-
+// +//
+//
{item.speackerImage}
+//
+//
{item.tags}
+//
{item.type}
+//
+//

{item.title}

+//

{extractDateTime(item.time).date}, в {extractDateTime(item.time).time} по Московскому времени

+//
+//
- )) - ) : ( -

Неверный тип данных с сервера!

- )} - {/* */} -
-
-
- -
- +// )) +// ) : ( +//

Неверный тип данных с сервера!

+// )} +// {/* */} +//
+//
+//
+// +//
+// - ); -} +// ); +// } -export default Home; +// export default Home; diff --git a/src/components/delete/Reactions.jsx b/src/components/delete/Reactions.jsx new file mode 100644 index 0000000..c0fc5f6 --- /dev/null +++ b/src/components/delete/Reactions.jsx @@ -0,0 +1,11 @@ +import React from 'react'; + +const DeleteReactions = () => { + return ( +
+ +
+ ); +} + +export default DeleteReactions; diff --git a/src/components/edit/EditForm.jsx b/src/components/edit/EditMeetsForm.jsx similarity index 67% rename from src/components/edit/EditForm.jsx rename to src/components/edit/EditMeetsForm.jsx index 0e207ed..42a6ae6 100644 --- a/src/components/edit/EditForm.jsx +++ b/src/components/edit/EditMeetsForm.jsx @@ -1,7 +1,7 @@ import React, { useRef, useState, useEffect } from 'react'; import { HttpApiMethods } from '../utils/FetchUtils'; -const EditForm = () => { +const EditMeetsForm = () => { const formRef = useRef(null); const [dataIsLoad, setDataIsLoad] = useState(false); const httpApiMethods = new HttpApiMethods(); @@ -13,14 +13,14 @@ const EditForm = () => { const updatedMeets = await httpApiMethods.EditMeetings(formData); }; - // const handleData = (data) => { - // if (Array.isArray(data) && data.length > 0) { - // setData(data); - // } else { - // setData([]); - // console.error('Неверный тип данных с сервера!'); - // } - // }; + const handleData = (data) => { + if (Array.isArray(data) && data.length > 0) { + setData(data); + } else { + setData([]); + console.error('Неверный тип данных с сервера!'); + } + }; const fetchData = async () => { try { @@ -41,10 +41,9 @@ const EditForm = () => { }; const handleChange = (event) => { - setSelectedData({ - ...selectedData, - [event.target.name]: event.target.value - }); + setSelectedId(event.target.value); + const selected = data.find((item) => item.id === event.target.value); + setSelectedData(selected); }; useEffect(() => { @@ -59,24 +58,31 @@ const EditForm = () => {

Edit

{dataIsLoad ? "Данные успешно загружены" : ""}
- -
    - {Array.isArray(data) && data.length > 0 ? ( - data.map((item, index) => ( - - )) - ) : ( -

    Неверный тип данных с сервера!

    - )} -
- {/* автозаполнение инпутов */} - {selectedData && ( - <> + +
    + {Array.isArray(data) && data.length > 0 ? ( + data.map((item, index) => ( + + )) + ) : ( +

    Неверный тип данных с сервера!

    + )} +
+ {/* автозаполнение инпутов */} + {selectedData && ( + <>
- + + {/* */} @@ -92,12 +98,12 @@ const EditForm = () => { -
- - )} - + + + )} +
); }; -export default EditForm; +export default EditMeetsForm; diff --git a/src/components/edit/EditQuestions.jsx b/src/components/edit/EditQuestions.jsx new file mode 100644 index 0000000..69d91d3 --- /dev/null +++ b/src/components/edit/EditQuestions.jsx @@ -0,0 +1,11 @@ +import React from 'react'; + +const EditQuestions = () => { + return ( +
+ +
+ ); +} + +export default EditQuestions; diff --git a/src/components/edit/EditReviews.jsx b/src/components/edit/EditReviews.jsx new file mode 100644 index 0000000..18dbc88 --- /dev/null +++ b/src/components/edit/EditReviews.jsx @@ -0,0 +1,11 @@ +import React from 'react'; + +const EditReviews = () => { + return ( +
+ +
+ ); +} + +export default EditReviews; diff --git a/src/components/edit/EditUsers.jsx b/src/components/edit/EditUsers.jsx new file mode 100644 index 0000000..36cc9dc --- /dev/null +++ b/src/components/edit/EditUsers.jsx @@ -0,0 +1,11 @@ +import React from 'react'; + +const EditUsers = () => { + return ( +
+ +
+ ); +} + +export default EditUsers; diff --git a/src/components/get/Meets.jsx b/src/components/get/Meets.jsx new file mode 100644 index 0000000..633d0f5 --- /dev/null +++ b/src/components/get/Meets.jsx @@ -0,0 +1,82 @@ +import React from 'react'; +import './style.css' +import styled from 'styled-components'; +// import { HttpApiMethods } from '../utils/FetchUtils'; +import {useState} from 'react' +import EditMeetsForm from '../edit/EditMeetsForm'; +import Grid from '@mui/material/Grid'; +// import Card from '../Card'; +import Box from '@mui/material/Box'; + + + +function extractDateTime(dateString) { + const dateTime = new Date(dateString); + const date = dateTime.toLocaleDateString(); + const time = dateTime.toLocaleTimeString(); + + return { date, time }; +} + +const httpApiMethods = new HttpApiMethods() + +const meets = await httpApiMethods.GetMeetings() + + + +export const MeetsGetByID = () => { + return ( +
+ +
+ ); +} + +const GetMeets = () => { + const [count, setCount] = useState(7) + + const filterMeet = meets.filter( (item, index) => index <= count ) + const allMeets = () => { + setCount(meets.length) + } + return ( + <> + + + + + {Array.isArray(meets) ? ( + filterMeet.map((item, index) => ( + + + +
+
{item.speackerImage}
+
+
{item.tags}
+
{item.type}
+
+

{item.title}

+

{extractDateTime(item.time).date}, в {extractDateTime(item.time).time} по Московскому времени

+
+
+ + + + )) + ) : ( +

Неверный тип данных с сервера!

+ )} + {/* */} +
+
+
+ +
+ + + + ); +} + +export default GetMeets; diff --git a/src/components/get/Questions.jsx b/src/components/get/Questions.jsx new file mode 100644 index 0000000..e5e4b4b --- /dev/null +++ b/src/components/get/Questions.jsx @@ -0,0 +1,53 @@ +import React from 'react'; +import { HttpApiMethods } from '../utils/FetchUtils'; + +const httpApiMethods = new HttpApiMethods + + + + +export const GetQuestions = async () => { + const questions = await httpApiMethods.GetQuestions() + + return ( +
+
+ {Array.isArray(questions) ? ( + questions.map((item, index) => ( +
+
{item.id}
+
{item.text}
+
{item.meetingId}
+
{item.userId}
+
+ )) + ) : ( +

Неверный тип данных с сервера!

+ )} +
+
+ ); +} + +const GetQuestionsByID = async (id) => { + const question = await httpApiMethods.GetByIDQuestions(id) + + return ( +
+ {Array.isArray(question) ? ( + question.map((item, index) => ( +
+
{item.id}
+
{item.text}
+
{item.meetingId}
+
{item.userId}
+
+ )) + ) : ( +

Неверный тип данных с сервера!

+ )} +
+ ); +} + +export default GetQuestionsByID; diff --git a/src/components/get/Reactions.jsx b/src/components/get/Reactions.jsx new file mode 100644 index 0000000..990a958 --- /dev/null +++ b/src/components/get/Reactions.jsx @@ -0,0 +1,19 @@ +import React from 'react'; + +export const GetByIDReactions = () => { + return ( +
+ +
+ ); +} + +const getReactions = () => { + return ( +
+ +
+ ); +} + +export default Reactions; diff --git a/src/components/get/Reviews.jsx b/src/components/get/Reviews.jsx new file mode 100644 index 0000000..9dbb567 --- /dev/null +++ b/src/components/get/Reviews.jsx @@ -0,0 +1,19 @@ +import React from 'react'; + +export const GetReviews = () => { + return ( +
+ +
+ ); +} + +const GetReviewsByID = () => { + return ( +
+ +
+ ); +} + +export default GetReviewsByID; diff --git a/src/components/get/User.jsx b/src/components/get/User.jsx new file mode 100644 index 0000000..ba1ee18 --- /dev/null +++ b/src/components/get/User.jsx @@ -0,0 +1,36 @@ +import React from 'react'; +import { HttpApiMethods } from '../utils/FetchUtils'; +import Cookies from 'js-cookie'; + +const User = () => { + let id = '9c69d5e7-74ec-4f92-af3a-fef7d30c55bb' + // Cookies.set('userId') + const user = new HttpApiMethods().GetUsers(id) + + if (!Array.isArray(user)) { + return

Неверный тип данных с сервера!

+ } + + return ( +
+ {user.map((item, index) => ( + +
+

{item.id}

+ {item.avatarUrl}/ +

{item.fio}

+

{item.specialities}

+ {item.telegramBotUrl} +

{item.level}

+

{item.userName}

+

{item.normalizedUserName}

+

{item.email}

+

{item.phoneNumber}

+

{item.id}

+
+ ))} +
+ ); +} + +export default User; diff --git a/src/components/post/PostForm.jsx b/src/components/post/Meets.jsx similarity index 100% rename from src/components/post/PostForm.jsx rename to src/components/post/Meets.jsx diff --git a/src/components/post/PostReviews.jsx b/src/components/post/PostReviews.jsx new file mode 100644 index 0000000..513a6a6 --- /dev/null +++ b/src/components/post/PostReviews.jsx @@ -0,0 +1,13 @@ +import React from 'react'; + +const PostReviews = () => { + + + return ( +
+ +
+ ); +} + +export default PostReviews; diff --git a/src/components/post/Questions.jsx b/src/components/post/Questions.jsx new file mode 100644 index 0000000..f8c6249 --- /dev/null +++ b/src/components/post/Questions.jsx @@ -0,0 +1,51 @@ +import React, { useRef, useState } from 'react'; +import { HttpApiMethods } from '../utils/FetchUtils'; +import Cookies from 'js-cookie'; + +const Questions = () => { + const formRef = useRef(null); + const [dataIsLoad, setDataIsLoad] = useState(false); + const [curentUser, setCurentUser] = useState(null); + + let post = async (event) => { + event.preventDefault(); + const httpApiMethods = new HttpApiMethods(); + const user_id = Cookies.get('userData') + let formData = new FormData(formRef.current); + + + + if (!formData.get('fio') || !formData.get('avatar') || !formData.get('userId') || !formData.get('text') || !formData.get('meetingId')) { + console.error('Ошибка: Не все поля формы заполнены'); + return; + } + + setDataIsLoad(false); + httpApiMethods.PostQuestions(formData).then(response => { + console.log(response) + setDataIsLoad(true); + meets_id = '9c69d5e7-74ec-4f92-af3a-fef7d30c55bb' + // let user_id = response.data.id; + // console.log(response) + // console.log(user_id) + }); + + } + + return ( +
+

Создание Questions, получение ID в Cookies

+
{dataIsLoad ? "Данные успешно загружены" : ""}
+
+ + {/* */} + + + + +
+
+ ); +} + +export default Questions; diff --git a/src/components/post/UserAuth.jsx b/src/components/post/UserAuth.jsx new file mode 100644 index 0000000..553375b --- /dev/null +++ b/src/components/post/UserAuth.jsx @@ -0,0 +1,13 @@ +import React from 'react'; + +const UserAuth = () => { + + + return ( +
+ +
+ ); +} + +export default UserAuth; diff --git a/src/components/post/Users.jsx b/src/components/post/Users.jsx new file mode 100644 index 0000000..00e073c --- /dev/null +++ b/src/components/post/Users.jsx @@ -0,0 +1,58 @@ +import React, { useRef, useState } from 'react'; +import { HttpApiMethods } from '../utils/FetchUtils'; +import Cookies from 'js-cookie'; + +export const PostUserModerator = () => { + return ( +
+ +
+ ); +} + + +const Users = () => { + const formRef = useRef(null); + const [dataIsLoad, setDataIsLoad] = useState(false); + const [curentUser, setCurentUser] = useState(null); + + let post = async (event) => { + event.preventDefault(); + const httpApiMethods = new HttpApiMethods(); + let formData = new FormData(formRef.current); + + if (!formData.get('fio') || !formData.get('avatar') || !formData.get('username') || !formData.get('specialities') || !formData.get('telegramBotUrl')) { + console.error('Ошибка: Не все поля формы заполнены'); + return; + } + + setDataIsLoad(false); + httpApiMethods.PostUsers(formData).then(response => { + console.log(response) + setDataIsLoad(true); + // let user_id = response.data.id; + // console.log(response) + // console.log(user_id) + Cookies.set('userId', response.id); + Cookies.set('token', response.token) + // return user_id + }); + } + + return ( +
+

Создание пользователя, получение ID в Cookies

+
{dataIsLoad ? "Данные успешно загружены" : ""}
+
+ + + + + + +
+
+ ); +} + +export default Users; diff --git a/src/components/post/postReactions.jsx b/src/components/post/postReactions.jsx new file mode 100644 index 0000000..e69de29 diff --git a/src/components/utils/FetchUtils.jsx b/src/components/utils/FetchUtils.jsx index cca9196..42590ae 100644 --- a/src/components/utils/FetchUtils.jsx +++ b/src/components/utils/FetchUtils.jsx @@ -2,14 +2,22 @@ import axios from "axios" import { useState } from "react" import './style.css' +import { Cookie } from "@mui/icons-material" export class HttpApiMethods { + + token; + HttpApiMethods() + { + token = Cookie,get('token') + } // URL`s + user_id = '17e5fc7a-8f22-4c0b-8b33-5dc3a6937561' APIURL = "https://cyberbloom.zetcraft.ru/api" APIURL_FILES = "https://cyberbloom.zetcraft.ru/api/cyber-boom-files/" -// получение мероприятий по ID + // получение мероприятий по ID GetByID = async (id) => { let innerUrl = this.APIURL + `/meetings?id=${id}` @@ -18,7 +26,12 @@ export class HttpApiMethods { return response.data; } -// Получение всех мероприятий + + + + // + // Получение всех мероприятий + // GetMeetings = async () => { let innerUrl = this.APIURL + `/meetings/list?offset=0&limit=20`; @@ -26,79 +39,218 @@ export class HttpApiMethods { return response.data; } -// Создание мероприятия + // Создание мероприятия AddMeetings = async (data) => { let innerUrl = this.APIURL + `/meetings`; - let response = await axios.postForm(innerUrl, data); + let response = await axios.postForm(innerUrl, data); // return response.data; } -// Редактирование уже существующего мероприятия + // Редактирование уже существующего мероприятия EditMeetings = async (data) => { let innerUrl = this.APIURL + `/meetings`; - let response = await axios.putForm(innerUrl, data); + let response = await axios.putForm(innerUrl, data); // return response.data; } -// Удалить мероприятие, пока что не реализовано + // Удалить мероприятие, пока что не реализовано DeleteMeetings = async (id) => { let innerUrl = this.APIURL + `/meetings?id=${id}` + const response = await axios.get(innerUrl) // + + return response.data; + } + + + + // + // Users + // + PostUsers = async (data) => { + let innerUrl = this.APIURL + `/users` + const responce = await axios.postForm(innerUrl, data) + return responce.data + } + PostUsersModerator = async (data) => { + let innerUrl = this.APIURL + `/users/moderator` + const responce = await axios.postForm(innerUrl, data, { headers: {"Authorization" : `Bearer ${token}`} }) + return responce.data.id + } + EditUsers = async (data) => { + let innerUrl = this.APIURL + `/users` + const responce = await axios.putForm(innerUrl, data, { headers: {"Authorization" : `Bearer ${token}`} }) // + return responce.data.id + } + GetUsers = async (id) => { + let innerUrl = this.APIURL + `/users?id=${id}` + + const responce = await axios.get(innerUrl) // + + return responce.data + } + GetUsersStats = async (id) => { + let innerUrl = this.APIURL + `/users/stats?id=${id}` + + const responce = await axios.get(innerUrl) // + + return responce.data + } + + + + // + // Questions + // + GetByIDQuestions = async (id) => { + + let innerUrl = this.APIURL + `/questions?id=${id}` + const response = await axios.get(innerUrl) return response.data; } + // Получение всех мероприятий + GetQuestions = async () => { + let innerUrl = this.APIURL + `/questions/list?offset=0&limit=20`; + + const response = await axios.get(innerUrl); + + return response.data; + } + // Создание мероприятия + PostQuestions = async (data) => { + let innerUrl = this.APIURL + `/questions`; + + let response = await axios.post(innerUrl, data, { headers: {"Authorization" : `Bearer ${token}`} }); // + return response.data; + + } + // Редактирование уже существующего мероприятия + EditQuestions = async (data) => { + let innerUrl = this.APIURL + `/questions`; + let response = await axios.put(innerUrl, data, { headers: {"Authorization" : `Bearer ${token}`} }); // + return response.data; + } + + + // + // Reactions + // + GetByIDReactions = async (id) => { + + let innerUrl = this.APIURL + `/reactions?id=${id}` + + const response = await axios.get(innerUrl) + + return response.data; + } + // Получение всех мероприятий + GetReactions = async () => { + let innerUrl = this.APIURL + `/reactions/list?offset=0&limit=20`; + + const response = await axios.get(innerUrl); + + return response.data; + } + // Создание мероприятия + PostReactions = async (data) => { + let innerUrl = this.APIURL + `/reactions`; + + let response = await axios.post(innerUrl, data, { headers: {"Authorization" : `Bearer ${token}`} }); // + return response.data; + + } + // Редактирование уже существующего мероприятия + DeleteReactions = async (id) => { + let innerUrl = this.APIURL + `/reactions?id=${id}`; + let response = await axios.delete(innerUrl, data, { headers: {"Authorization" : `Bearer ${token}`} }); // + return response.data; + } + + // + // Reviews + // + GetByIDReviews = async (id) => { + + let innerUrl = this.APIURL + `/reviews?id=${id}` + + const response = await axios.get(innerUrl) + + return response.data; + } + GetReviews = async () => { + let innerUrl = this.APIURL + `/reviews/list?offset=0&limit=20`; + + const response = await axios.get(innerUrl); + + return response.data; + } + // Создание мероприятия + PostReviews = async (data) => { + let innerUrl = this.APIURL + `/reviews`; + + let response = await axios.post(innerUrl, data, { headers: {"Authorization" : `Bearer ${token}`} }); // + return response.data; + + } + // Редактирование уже существующего мероприятия + EditReviews = async (data) => { + let innerUrl = this.APIURL + `/reviews`; + let response = await axios.put(innerUrl, data, { headers: {"Authorization" : `Bearer ${token}`} }); // + return response.data; + } } -const httpApiMethods = new HttpApiMethods() // Создание экземпляра класса HttpApiMethods -const meets = httpApiMethods.GetMeetings() -const FetchUtils = () => { +const FetchUtils = async () => { + const httpApiMethods = new HttpApiMethods() // Создание экземпляра класса HttpApiMethods + const meets = await httpApiMethods.GetMeetings() const [user, setUser] = useState([]) -// async function getData() { -// const response = await axios.get(APIURL) -// console.log(response.data) -// setUser(response.data) -// } + // async function getData() { + // const response = await axios.get() + // console.log(response.data) + // setUser(response.data) + // } -// const removeList = () => { -// setUser([]) + const removeList = () => { + setUser([]) } -// return ( -// <> -// -// -// {/* Mapping of data */} -//
-// {/* {Array.isArray(meets) ? ( -//
    -// {meets.map((item) => ( -//
      -//
    1. {item.title}
    2. -//
    3. {item.time}
    4. -//
    5. {item.speakerName}
    6. -//
    7. {item.speackerImage}
    8. -//
    9. {item.splecializations}
    10. -//
    11. {item.type}
    12. -//
    13. {item.speakerTelephone}
    14. -//
    15. {item.speakerEmail}
    16. -//
    17. {item.tags}
    18. -//
    19. {item.videoUrl}
    20. -//
    -// ))} -//
-// ) : ( -//

Bad data type from server!

-// )} */} -//
-// -// ); -// } -// export default FetchUtils; \ No newline at end of file + return ( + <> + + + {/* Mapping of data */} +
+ {Array.isArray(meets) ? ( +
    + {meets.map((item) => ( +
      +
    1. {item.title}
    2. +
    3. {item.time}
    4. +
    5. {item.speakerName}
    6. +
    7. {item.speackerImage}
    8. +
    9. {item.splecializations}
    10. +
    11. {item.type}
    12. +
    13. {item.speakerTelephone}
    14. +
    15. {item.speakerEmail}
    16. +
    17. {item.tags}
    18. +
    19. {item.videoUrl}
    20. +
    + ))} +
+ ) : ( +

Bad data type from server!

+ )} +
+ + ); +} +export default FetchUtils; \ No newline at end of file