Resoues point started
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import React, { useState } from "react";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
import authProfilePic from "../../assets/images/auth-profile-picture.png";
|
||||
import profileBanner from "../../assets/images/profile-cover.png";
|
||||
@@ -13,6 +13,8 @@ import HiddenProductsTab from "./HiddenProductsTab";
|
||||
import OnSaleTab from "./OnSaleTab";
|
||||
import OwnTab from "./OwnTab";
|
||||
|
||||
import usersService from "../../services/UsersService";
|
||||
|
||||
export default function Resources() {
|
||||
const onSaleProducts = marketPlace.data;
|
||||
const CreatedSell = marketPlace.data;
|
||||
@@ -54,6 +56,31 @@ export default function Resources() {
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
const api = new usersService();
|
||||
|
||||
const [isLoading, setIsLoading] = useState(true)
|
||||
|
||||
const [userResources, setUserResource] = useState([]);
|
||||
|
||||
|
||||
const getUserResources = async () => {
|
||||
try {
|
||||
const res = await api.getUserResources();
|
||||
|
||||
// setUserResource(res.data.reminders);
|
||||
setIsLoading(false)
|
||||
|
||||
}catch(error) {
|
||||
setIsLoading(false)
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
getUserResources();
|
||||
}, []);
|
||||
|
||||
|
||||
const [tab, setTab] = useState(tabs[0].name);
|
||||
const tabHandler = (value) => {
|
||||
setTab(value);
|
||||
|
||||
@@ -24,13 +24,18 @@ class usersService {
|
||||
return this.getAuxEnd("/loginhx", reqData);
|
||||
}
|
||||
|
||||
getUserResources(){
|
||||
var reqData = {
|
||||
member_id: localStorage.getItem("member_id")
|
||||
};
|
||||
return this.getAuxEnd("/resources", reqData);
|
||||
}
|
||||
//---------------------------------------- -----
|
||||
//---------------------------------------- -----
|
||||
// Unified call below
|
||||
//---------------------------------------- -----
|
||||
//---------------------------------------- -----
|
||||
getAuxEnd(uri, reqData) {
|
||||
// debugger;
|
||||
const session_token = localStorage.getItem("session_token");
|
||||
let axiosConfig = {
|
||||
headers: {
|
||||
@@ -40,7 +45,10 @@ class usersService {
|
||||
}
|
||||
};
|
||||
const endPoint = process.env.REACT_APP_USERS_ENDPOINT + uri;
|
||||
return Axios.get(endPoint,axiosConfig,reqData)
|
||||
return Axios.get(endPoint,{
|
||||
params: {
|
||||
reqData
|
||||
}})
|
||||
.then((response) => {
|
||||
console.log("~~~~~~~ Toks2 GET ~~~~~~~~");
|
||||
return response;
|
||||
|
||||
Reference in New Issue
Block a user