From b39f4da57d0fffb7f5221862ccb3690531a92043 Mon Sep 17 00:00:00 2001 From: MD MAAZ AHMAD <1hk19cs078@hkbk.edu.in> Date: Mon, 29 May 2023 14:15:21 +0530 Subject: [PATCH 1/4] feat: signup, feed ui and api --- db.json | 89 ++++++++++++++++++++--- src/api/auth.js | 6 +- src/api/profile .js | 10 +++ src/components/Button.js | 0 src/components/fields/Button.js | 2 +- src/config/url.js | 3 +- src/index.js | 4 ++ src/views/auth/Login/Form.js | 29 +++++--- src/views/auth/Login/index.js | 12 ++-- src/views/auth/Signup/Signup.js | 122 ++++++++++++++++++++++++++++++++ src/views/auth/Signup/index.js | 24 +++++++ src/views/employees/Form.js | 109 ++++++++++++++++++++++++---- src/views/feed/CreateBlog.js | 24 +++++++ src/views/feed/Form.js | 114 +++++++++++++++++++++++++++++ src/views/feed/feed.scss | 10 ++- src/views/feed/index.js | 56 ++++++++++++++- 16 files changed, 568 insertions(+), 46 deletions(-) create mode 100644 src/api/profile .js delete mode 100644 src/components/Button.js create mode 100644 src/views/auth/Signup/Signup.js create mode 100644 src/views/auth/Signup/index.js create mode 100644 src/views/feed/CreateBlog.js create mode 100644 src/views/feed/Form.js diff --git a/db.json b/db.json index 6dff256..6030d1e 100644 --- a/db.json +++ b/db.json @@ -1,12 +1,85 @@ { - "user": { - "id": 1, - "name": "Anup", - "email": "anup.singh@gmail.com", - "password": "123123123", - "profilePhoto": "", - "phonme": "98181311488" - }, + "user": [ + { + "name": "Niraj yadav", + "phone": "8102162627", + "email": "Niraj@gamil.com", + "password": "123456", + "profilePhoto": { + "0": {} + }, + "id": "11ad4790-33bb-4fb1-84e1-c2d3dbfcedd5" + }, + { + "name": "vikash", + "phone": "8102162627", + "email": "Rupesh@gamil.com", + "password": "123123123", + "profilePhoto": { + "0": {} + }, + "id": "8d62203a-2e0f-45bf-b0b0-094da9d78758" + } + ], + "blog": [ + { + "id": 1, + "user_id": 12, + "title": "Art", + "description": "User Interface Designer", + "location": "New York", + "workType": "Full-Time", + "createdAt": "2h ago" + }, + { + "title": "Finance", + "description": "Upgrade your finacial score", + "location": "Gremany", + "workType": "Full Time", + "createdAt": "09:12", + "id": "047d6e54-4d0e-4c00-a895-9036f522c7ce" + }, + { + "title": "Medical", + "description": "Medical Science", + "location": "India", + "workType": "Part Time", + "createdAt": "09:16", + "id": "327198a3-088d-47c5-a536-5a708a6d04cf" + }, + { + "title": "Marketing", + "description": "Markeing experience", + "location": "Norway", + "workType": "Full Time", + "createdAt": "21:17", + "id": "27f45704-b9aa-464b-911a-e0170d2045cb" + }, + { + "title": "sports", + "description": "cricket", + "location": "Banglore ", + "workType": "Full Time", + "createdAt": "20:49", + "id": "a4d03cfb-b51e-4287-aebc-f9f956adf8f1" + }, + { + "title": "Java Developer", + "description": "FullStack Java Developer", + "location": "INdia", + "workType": "Full Time", + "createdAt": "07:32", + "id": "e41fbadc-7fef-4c18-bd1c-cfef262cfc74" + }, + { + "title": "Sports", + "description": "Football", + "location": "India", + "workType": "Full Time", + "createdAt": "16:06", + "id": "14a3f625-9386-4e78-a200-9f2ac9973afe" + } + ], "employees": [ { "_id": 1, diff --git a/src/api/auth.js b/src/api/auth.js index 7cd561b..9d083b4 100644 --- a/src/api/auth.js +++ b/src/api/auth.js @@ -25,16 +25,12 @@ class AuthApi { static signin = (data) => { return axios.post(`${base}/auth/signin`,data) } - static Register = (data) => { return axios.post(`${base}/register`, data); }; - static Logout = (data) => { return axios.post(`${base}/logout`, data, { headers: { Authorization: `${data.token}` } }); }; } - let base = "users"; - -export default AuthApi; +export default AuthApi; \ No newline at end of file diff --git a/src/api/profile .js b/src/api/profile .js new file mode 100644 index 0000000..2357d59 --- /dev/null +++ b/src/api/profile .js @@ -0,0 +1,10 @@ +import axios from "./index"; + +class ProfileApi { + + static edit = (id, body) => { + return axios.put(`/user/${id}`, body) + } +} + +export default ProfileApi; \ No newline at end of file diff --git a/src/components/Button.js b/src/components/Button.js deleted file mode 100644 index e69de29..0000000 diff --git a/src/components/fields/Button.js b/src/components/fields/Button.js index 690c467..d29c02a 100644 --- a/src/components/fields/Button.js +++ b/src/components/fields/Button.js @@ -9,7 +9,7 @@ const Button = (props) => { type={type} {...rest} > - {icon && }{{text}} + {icon && }{text} ); }; diff --git a/src/config/url.js b/src/config/url.js index 1d2c9ec..6cea4c4 100644 --- a/src/config/url.js +++ b/src/config/url.js @@ -10,5 +10,6 @@ const PROFILE_URL = '/profile'; // Auth const LOGIN_URL = '/login'; +const SIGNUP_URL = '/signup'; -export {ROOT_URL, EMPLOYEE_FORM, EMPLOYEE_LIST_URL, LOGIN_URL, FEED_URL, PROFILE_URL}; \ No newline at end of file +export {ROOT_URL, EMPLOYEE_FORM, EMPLOYEE_LIST_URL, LOGIN_URL, FEED_URL, PROFILE_URL, SIGNUP_URL}; \ No newline at end of file diff --git a/src/index.js b/src/index.js index 613079a..13c392a 100644 --- a/src/index.js +++ b/src/index.js @@ -5,6 +5,8 @@ import App from "./App"; import { BrowserRouter as Router, Routes, Route } from "react-router-dom"; import Feed from "./views/feed"; import Login from "./views/auth/Login"; +import Signup from "./views/auth/Signup/index"; +import CreateBlog from "./views/feed/CreateBlog" import Dashboard from "./views/dashboard"; import EmployeeForm from "./views/employees/Form"; import { Profile } from "./views/employees/Profile"; @@ -38,6 +40,8 @@ root.render( } /> } /> } /> + } /> + } /> diff --git a/src/views/auth/Login/Form.js b/src/views/auth/Login/Form.js index 52ddb47..969c5f6 100644 --- a/src/views/auth/Login/Form.js +++ b/src/views/auth/Login/Form.js @@ -3,10 +3,10 @@ import { useForm } from "react-hook-form"; import AuthApi from "../../../api/auth"; import Swal from "sweetalert2"; import { useAuth } from "../../../context/AuthProvider"; -import { useNavigate } from "react-router-dom"; -import Button from "../../../components/fields/Button"; +import { useNavigate, Link } from "react-router-dom"; import { PROFILE_URL } from "../../../config/url"; import InputField from "../../../components/fields/InputField"; +import Button from "../../../components/fields/Button"; const LoginForm = () => { const { @@ -20,19 +20,22 @@ const LoginForm = () => { useEffect(() => { if (user) { console.log("user", user); - navigate(PROFILE_URL); + // navigate(PROFILE_URL); } }, [user]); + + const onSubmit = (data) => { // setUser(data); - console.log("user =---->", JSON.stringify(data)); + localStorage.setItem("user =---->", JSON.stringify(data)); - // call an API to login + // call an API to login // when api gives success response, navigate to root url - AuthApi.login(data).then((result) => { - console.log("signin -> ", result); + AuthApi.login(data).then((result) => { + console.log("signin -> ", result); if (result.status === 200) { + navigate(PROFILE_URL); Swal.fire({ timer: 1500, showConfirmButton: false, @@ -88,7 +91,6 @@ const LoginForm = () => { }} placeholder="Email" errors={errors} - required />
@@ -105,7 +107,6 @@ const LoginForm = () => { }} placeholder="Password" errors={errors} - required />
@@ -113,13 +114,21 @@ const LoginForm = () => { Forgot password?
+
-
+ + + + +
+
+ + ); +}; + +export default SignupForm; diff --git a/src/views/auth/Signup/index.js b/src/views/auth/Signup/index.js new file mode 100644 index 0000000..9420868 --- /dev/null +++ b/src/views/auth/Signup/index.js @@ -0,0 +1,24 @@ +import React,{useState} from "react"; +import SignupForm from "./Signup"; +import "../auth.scss"; + +const Signup = () => { + + + return ( +
+
+
+
+
+
Sign Up
+ +
+
+
+
+
+ ); +}; + +export default Signup; diff --git a/src/views/employees/Form.js b/src/views/employees/Form.js index 27d0136..4115469 100644 --- a/src/views/employees/Form.js +++ b/src/views/employees/Form.js @@ -195,18 +195,103 @@ const EmployeeForm = ({selectedEmployee = null }) => { {errors.description && This field is required}
- - navigate("/")} - /> - - + + + + + {errors.lastName && This field is required} + + +
+
+ State} + value={selectedState} + onChange={(e) => setSelectedState(e.target.value)} + className="form-control" + options={states} + /> +
+ +
+ City} + value={selectedCity} + onChange={(e) => setSelectedCity(e.target.value)} + className="form-control" + options={cities} + disabled={!selectedState} + /> +
+ +
+ Code} + value={selectedCity} + onChange={(e) => setSelectedCity(e.target.value)} + className="form-control" + options={postalCodes} + disabled={!selectedState} + /> +
+
+ + + {errors.email && This field is required} + + + + {errors.salary && This field is required} + +
+ + + {errors.description && This field is required} +
+ + + navigate("/")} + /> + + ); }; diff --git a/src/views/feed/CreateBlog.js b/src/views/feed/CreateBlog.js new file mode 100644 index 0000000..e07c327 --- /dev/null +++ b/src/views/feed/CreateBlog.js @@ -0,0 +1,24 @@ +import React from "react"; +import BlogForm from "./Form"; +import "../auth/auth.scss"; + +const CreateBlog = () => { + + + return ( +
+
+
+
+
+
Create Your Own Blog!!!
+ +
+
+
+
+
+ ); +}; + +export default CreateBlog; diff --git a/src/views/feed/Form.js b/src/views/feed/Form.js new file mode 100644 index 0000000..4c6728d --- /dev/null +++ b/src/views/feed/Form.js @@ -0,0 +1,114 @@ +import React, { useState } from "react"; +import { useForm } from "react-hook-form"; +import AuthApi from "../../api/auth"; +import Swal from "sweetalert2"; +import { generateId } from "../../utils"; +import { useNavigate } from "react-router-dom"; +import { FEED_URL } from "../../config/url"; + +const BlogForm = () => { + const { + register, + handleSubmit, + formState: { errors }, + } = useForm(); + + const navigate = useNavigate(); + const [blog, setBlog] = useState({ + title: "", + description: "", + type: "", + location: "", + workType: "", + createdAt: "", + }); + + const onSubmit = (data) => { + console.log("Invalid data", data); + const newBlog = data; + newBlog.id = generateId(); + + AuthApi.createBlog(newBlog).then((result) => { + if (result.status === 201) { + console.log(result.data); + localStorage.setItem("employees_data", JSON.stringify(data)); + setBlog(newBlog); + navigate(FEED_URL); + Swal.fire({ + icon: "success", + title: "Added!", + text: `Your Blog has been Added.`, + showConfirmButton: false, + timer: 3000, + }); + } else { + Swal.fire({ + icon: "failure", + title: "Failed!", + text: `Your Blog has not been Added.`, + showConfirmButton: false, + timer: 3000, + }); + } + }); + }; + + return ( +
+
+ + + {errors.title && Required*} +
+
+ + + {errors.description && Required*} +
+
+ + + {errors.location && Required*} +
+
+ + + {errors.workType && Required*} +
+
+ + + {errors.createdAt && Required*} +
+
+ +
+ ); +}; + +export default BlogForm; diff --git a/src/views/feed/feed.scss b/src/views/feed/feed.scss index f66410b..1aeb3fd 100644 --- a/src/views/feed/feed.scss +++ b/src/views/feed/feed.scss @@ -20,7 +20,15 @@ text-decoration: none; border-bottom: 3px solid transparent; } - + .w-100{ + width: 100%; + } + .m-all-1rem{ + margin: 1rem 1.5rem 1rem 1rem; + } + .f-right{ + float : right; + } .topnav a:hover { color: black; border-bottom: 3px solid red; diff --git a/src/views/feed/index.js b/src/views/feed/index.js index 5801276..35f8d5e 100644 --- a/src/views/feed/index.js +++ b/src/views/feed/index.js @@ -1,8 +1,27 @@ -import React from 'react'; +import React,{useState, useEffect} from 'react'; import Header from '../../components/Navbar'; +import AuthApi from "../../api/auth"; import './feed.scss'; +import { Link } from "react-router-dom"; +import { useQuery } from "react-query"; const Feed = () => { + + const [user, setUser] =useState({title:"", description:"", createdAt:"", workType:"", location:""}) + + const [feed, setFeed] = useState(); + // const { data, isLoading, error, refetch } = useQuery("feed", AuthApi.getBlog); + useEffect(() => { + async function getBooking() { + const result = await AuthApi.getBlog(user) + console.log("result",result) + console.log(result.data); + setFeed(result.data); + + } + getBooking(); + }, []); + return ( <>
@@ -15,6 +34,7 @@ const Feed = () => { -
+
+ + + +
+
@@ -174,6 +199,33 @@ const Feed = () => {
+ + {feed?.map((feed) => ( +
+
+
+ {feed.title} +
{feed.description}
+
    +
  • +

    {feed.location}

    +
  • +
  • +

    {feed.workType}

    +
  • +
+
+
+

Globe Solution Ltd.

+
+ {feed.createdAt} +
+
+
+
+ ))} + +
Find More From 150909bd5de5ba97933bcf6cb37e6a16efe18b76 Mon Sep 17 00:00:00 2001 From: MD MAAZ AHMAD <1hk19cs078@hkbk.edu.in> Date: Thu, 1 Jun 2023 16:47:51 +0530 Subject: [PATCH 2/4] feed :useQuery --- db.json | 70 +++++++++++++++++++++++++++++++++ src/views/auth/Login/Form.js | 12 +++--- src/views/auth/Signup/Signup.js | 24 ++++++----- src/views/dashboard/index.js | 1 + src/views/employees/Form.js | 2 +- src/views/feed/Form.js | 13 ++---- src/views/feed/index.js | 24 ++++------- 7 files changed, 105 insertions(+), 41 deletions(-) diff --git a/db.json b/db.json index 6030d1e..b0483a6 100644 --- a/db.json +++ b/db.json @@ -19,6 +19,76 @@ "0": {} }, "id": "8d62203a-2e0f-45bf-b0b0-094da9d78758" + }, + { + "name": "md maaz", + "phone": "08102162627", + "email": "Maa12@gmail.com", + "password": "123456", + "profilePhoto": { + "0": {} + }, + "id": "b733170b-039c-44e8-8561-964d7b4cd986" + }, + { + "id": "esfmrKp" + }, + { + "id": "WQlLbUT" + }, + { + "id": "4CD0RUd" + }, + { + "id": "kXGtiql" + }, + { + "id": "5vwPEny" + }, + { + "id": "JE605SN" + }, + { + "id": "VbF7_zY" + }, + { + "id": "Ymv4oph" + }, + { + "id": "1qF92zN" + }, + { + "id": "EaFZyUq" + }, + { + "id": "wua9PET" + }, + { + "id": "0hLucRp" + }, + { + "id": "lAfd6jj" + }, + { + "id": "vP1tLNk" + }, + { + "id": "6yMdnUR" + }, + { + "id": "d3X9tOs" + }, + { + "id": "Wl7oe9u" + }, + { + "id": "DBl2nQl" + }, + { + "id": "mHgx0Po" + }, + { + "id": "bw9rB_I" } ], "blog": [ diff --git a/src/views/auth/Login/Form.js b/src/views/auth/Login/Form.js index 969c5f6..d9e93c6 100644 --- a/src/views/auth/Login/Form.js +++ b/src/views/auth/Login/Form.js @@ -17,12 +17,12 @@ const LoginForm = () => { const { user, setUser } = useAuth(); const navigate = useNavigate(); - useEffect(() => { - if (user) { - console.log("user", user); - // navigate(PROFILE_URL); - } - }, [user]); + // useEffect(() => { + // if (user) { + // console.log("user", user); + // // navigate(PROFILE_URL); + // } + // }, [user]); diff --git a/src/views/auth/Signup/Signup.js b/src/views/auth/Signup/Signup.js index 830ab6f..29ebb66 100644 --- a/src/views/auth/Signup/Signup.js +++ b/src/views/auth/Signup/Signup.js @@ -7,7 +7,7 @@ import { useAuth } from "../../../context/AuthProvider"; import InputField from "../../../components/fields/InputField"; import { useNavigate } from "react-router-dom"; import { ROOT_URL, LOGIN_URL } from "../../../config/url"; -import axios from "axios"; +import { useMutation } from "react-query"; const SignupForm = () => { const { register, @@ -16,14 +16,20 @@ const SignupForm = () => { } = useForm(); const navigate = useNavigate(); - const [user, setUser] = useState({ - name: "", - phone: "", - email: "", - password: "", - profilePhoto: "", - }); + const { user, setUser } = useAuth(); + // const addUser = (ad) => { + // AuthApi.signup(ad); + // }; + + + // const { mutate: addBlog } = useMutation(addUser()); + + + // const onSubmit = (data) => { + // const blog = { data }; + // addBlog(blog); + // }; const onSubmit = (data) => { console.log("Invalid data", data); @@ -76,7 +82,7 @@ const SignupForm = () => { {errors.phone && Required*}
- + { const [employees, setEmployees] = useState([]); const [selectedEmployee, setSelectedEmployee] = useState(null); const { data, isLoading, error, refetch } = useQuery("employees", EmployeeApi.getAllEmployees, employeesQueryConfig); + const navigate = useNavigate(); const { mode, setMode } = useNavigation(); diff --git a/src/views/employees/Form.js b/src/views/employees/Form.js index 4115469..f885622 100644 --- a/src/views/employees/Form.js +++ b/src/views/employees/Form.js @@ -1,6 +1,6 @@ import React, { useState } from "react"; import Swal from "sweetalert2"; -import { useForm } from "react-hook-form"; +import { useForm } from "react-hook-form"; import { generateId } from "../../utils"; import { useNavigate } from "react-router-dom"; import InputField from "../../components/fields/InputField"; diff --git a/src/views/feed/Form.js b/src/views/feed/Form.js index 4c6728d..7ab0573 100644 --- a/src/views/feed/Form.js +++ b/src/views/feed/Form.js @@ -2,6 +2,7 @@ import React, { useState } from "react"; import { useForm } from "react-hook-form"; import AuthApi from "../../api/auth"; import Swal from "sweetalert2"; +import { useAuth } from "../../context/AuthProvider"; import { generateId } from "../../utils"; import { useNavigate } from "react-router-dom"; import { FEED_URL } from "../../config/url"; @@ -14,14 +15,8 @@ const BlogForm = () => { } = useForm(); const navigate = useNavigate(); - const [blog, setBlog] = useState({ - title: "", - description: "", - type: "", - location: "", - workType: "", - createdAt: "", - }); + + const { user, setUser } = useAuth(); const onSubmit = (data) => { console.log("Invalid data", data); @@ -32,7 +27,7 @@ const BlogForm = () => { if (result.status === 201) { console.log(result.data); localStorage.setItem("employees_data", JSON.stringify(data)); - setBlog(newBlog); + setUser(newBlog); navigate(FEED_URL); Swal.fire({ icon: "success", diff --git a/src/views/feed/index.js b/src/views/feed/index.js index 35f8d5e..14da28a 100644 --- a/src/views/feed/index.js +++ b/src/views/feed/index.js @@ -2,25 +2,18 @@ import React,{useState, useEffect} from 'react'; import Header from '../../components/Navbar'; import AuthApi from "../../api/auth"; import './feed.scss'; -import { Link } from "react-router-dom"; import { useQuery } from "react-query"; +import { Link } from "react-router-dom"; +import Spinner from "../../layouts/Spinner"; const Feed = () => { - const [user, setUser] =useState({title:"", description:"", createdAt:"", workType:"", location:""}) - - const [feed, setFeed] = useState(); - // const { data, isLoading, error, refetch } = useQuery("feed", AuthApi.getBlog); - useEffect(() => { - async function getBooking() { - const result = await AuthApi.getBlog(user) - console.log("result",result) - console.log(result.data); - setFeed(result.data); - + + const { data, isLoading, error, refetch } = useQuery("feed", AuthApi.getBlog); + console.log("useQuery",data) + if(isLoading){ + return } - getBooking(); - }, []); return ( <> @@ -199,8 +192,7 @@ const Feed = () => {
- - {feed?.map((feed) => ( + {data?.data.map((feed) => (
From 8d2a05b5bc5d30b66a4babe90a60af6b1a23ee2a Mon Sep 17 00:00:00 2001 From: Anup Kumar Singh Date: Sat, 3 Jun 2023 09:38:49 +0530 Subject: [PATCH 3/4] common components --- db.json | 72 ++------ src/api/auth.js | 12 +- src/components/fields/Button.js | 2 +- src/views/auth/Login/Form.js | 13 +- src/views/auth/Signup/Signup.js | 65 +++---- src/views/feed/index.js | 305 +++++++++++--------------------- 6 files changed, 160 insertions(+), 309 deletions(-) diff --git a/db.json b/db.json index b0483a6..cbd9977 100644 --- a/db.json +++ b/db.json @@ -31,64 +31,24 @@ "id": "b733170b-039c-44e8-8561-964d7b4cd986" }, { - "id": "esfmrKp" - }, - { - "id": "WQlLbUT" - }, - { - "id": "4CD0RUd" - }, - { - "id": "kXGtiql" - }, - { - "id": "5vwPEny" - }, - { - "id": "JE605SN" - }, - { - "id": "VbF7_zY" - }, - { - "id": "Ymv4oph" - }, - { - "id": "1qF92zN" - }, - { - "id": "EaFZyUq" - }, - { - "id": "wua9PET" - }, - { - "id": "0hLucRp" - }, - { - "id": "lAfd6jj" - }, - { - "id": "vP1tLNk" - }, - { - "id": "6yMdnUR" - }, - { - "id": "d3X9tOs" - }, - { - "id": "Wl7oe9u" - }, - { - "id": "DBl2nQl" - }, - { - "id": "mHgx0Po" + "name": "Anup", + "phone": "12312313", + "email": "anup.singh2071@gmail.com", + "password": "12312313", + "profilePhoto": { + "0": {} + }, + "id": "a615e268-bd88-4f70-a9c6-822d92261cf5" }, { - "id": "bw9rB_I" + "name": "Anup Kumar Singh", + "phone": "699999", + "email": "anup.singh71@gmail.com", + "password": "123123123", + "profilePhoto": { + "0": {} + }, + "id": "d2100bb1-009e-4ea3-b92a-66fb440987d1" } ], "blog": [ diff --git a/src/api/auth.js b/src/api/auth.js index 9d083b4..274f6f4 100644 --- a/src/api/auth.js +++ b/src/api/auth.js @@ -6,8 +6,12 @@ class AuthApi { return axios.get(`/user/`, params) } - static signup = (params) => { - return axios.post(`/user/`, params) + static signup = (data) => { + return axios({ + method: 'post', + url: `${BASE_URL}/user`, + data: data + }) } static createBlog = (blog) => { @@ -18,8 +22,8 @@ class AuthApi { }) } - static getBlog = (blog) => { - return axios.get(`${BASE_URL}/blog`, blog) + static getBlog = (blog, page, limit) => { + return axios.get(`${BASE_URL}/blog?_page=${page}&_limit=${limit}`, blog) } static signin = (data) => { diff --git a/src/components/fields/Button.js b/src/components/fields/Button.js index d29c02a..27c761a 100644 --- a/src/components/fields/Button.js +++ b/src/components/fields/Button.js @@ -5,7 +5,7 @@ const Button = (props) => { props; return (
@@ -115,12 +116,12 @@ const LoginForm = () => {
- + + - +
- - - + + +
+ {data?.data.map((feed) => (
-
-
- Creative & Art -
User Experience Designer Employee
-
    -
  • -

    New York, USA

    -
  • -
  • -

    Full Time

    -
  • -
-
-
-

Globe Solution Ltd.

-
- 2h ago -
-
-
-
-
-
-
- Finance & Accounting -
Foreign Language Research Analyst
-
    -
  • -

    New York, USA

    -
  • -
  • -

    Full Time

    -
  • -
-
-
-

Globe Solution Ltd.

-
- 2h ago -
-
-
-
-
-
-
- Medical -
Medical Assistant, East Valley Primary Care
-
    -
  • -

    New York, USA

    -
  • -
  • -

    Full Time

    -
  • -
-
-
-

Globe Solution Ltd.

-
- 2h ago -
+
+
+ {feed.title} +
+ {feed.description} +
+
    +
  • +

    + {" "} + {feed.location} +

    +
  • +
  • +

    + + {feed.workType} +

    +
  • +
+
+
+

+ {feed.createdAt} +
+
-
-
-
- Corporate -
Foreign Language Research Analyst
-
    -
  • -

    New York, USA

    -
  • -
  • -

    Full Time

    -
  • -
-
-
-

Globe Solution Ltd.

-
- 2h ago -
-
-
-
-
-
-
- Marketing -
User Experience Designer Employee
-
    -
  • -

    New York, USA

    -
  • -
  • -

    Full Time

    -
  • -
-
-
-

Globe Solution Ltd.

-
- 2h ago -
-
-
-
-
-
-
- Programming & IT -
Medical Assistant, East Valley Primary Care
-
    -
  • -

    New York, USA

    -
  • -
  • -

    Full Time

    -
  • -
-
-
-

Globe Solution Ltd.

-
- 2h ago -
-
-
-
- {data?.data.map((feed) => ( -
-
-
- {feed.title} -
{feed.description}
-
    -
  • -

    {feed.location}

    -
  • -
  • -

    {feed.workType}

    -
  • -
-
-
-

Globe Solution Ltd.

-
- {feed.createdAt} -
-
-
-
- ))} - + ))} -
-
- Find More - -
+
+
+ Find More +
+
-
+
); }; From a47a196224c5bb67ad70cf21e798343d6e4689ee Mon Sep 17 00:00:00 2001 From: Anup Kumar Singh Date: Sat, 3 Jun 2023 09:47:44 +0530 Subject: [PATCH 4/4] fix: getBlog --- src/api/auth.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/auth.js b/src/api/auth.js index 274f6f4..2d018f0 100644 --- a/src/api/auth.js +++ b/src/api/auth.js @@ -22,7 +22,7 @@ class AuthApi { }) } - static getBlog = (blog, page, limit) => { + static getBlog = (blog, page=1, limit=10) => { return axios.get(`${BASE_URL}/blog?_page=${page}&_limit=${limit}`, blog) }