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 { Link } from "react-router-dom";
|
||||||
import authProfilePic from "../../assets/images/auth-profile-picture.png";
|
import authProfilePic from "../../assets/images/auth-profile-picture.png";
|
||||||
import profileBanner from "../../assets/images/profile-cover.png";
|
import profileBanner from "../../assets/images/profile-cover.png";
|
||||||
@@ -13,6 +13,8 @@ import HiddenProductsTab from "./HiddenProductsTab";
|
|||||||
import OnSaleTab from "./OnSaleTab";
|
import OnSaleTab from "./OnSaleTab";
|
||||||
import OwnTab from "./OwnTab";
|
import OwnTab from "./OwnTab";
|
||||||
|
|
||||||
|
import usersService from "../../services/UsersService";
|
||||||
|
|
||||||
export default function Resources() {
|
export default function Resources() {
|
||||||
const onSaleProducts = marketPlace.data;
|
const onSaleProducts = marketPlace.data;
|
||||||
const CreatedSell = 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 [tab, setTab] = useState(tabs[0].name);
|
||||||
const tabHandler = (value) => {
|
const tabHandler = (value) => {
|
||||||
setTab(value);
|
setTab(value);
|
||||||
|
|||||||
@@ -24,13 +24,18 @@ class usersService {
|
|||||||
return this.getAuxEnd("/loginhx", reqData);
|
return this.getAuxEnd("/loginhx", reqData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getUserResources(){
|
||||||
|
var reqData = {
|
||||||
|
member_id: localStorage.getItem("member_id")
|
||||||
|
};
|
||||||
|
return this.getAuxEnd("/resources", reqData);
|
||||||
|
}
|
||||||
//---------------------------------------- -----
|
//---------------------------------------- -----
|
||||||
//---------------------------------------- -----
|
//---------------------------------------- -----
|
||||||
// Unified call below
|
// Unified call below
|
||||||
//---------------------------------------- -----
|
//---------------------------------------- -----
|
||||||
//---------------------------------------- -----
|
//---------------------------------------- -----
|
||||||
getAuxEnd(uri, reqData) {
|
getAuxEnd(uri, reqData) {
|
||||||
// debugger;
|
|
||||||
const session_token = localStorage.getItem("session_token");
|
const session_token = localStorage.getItem("session_token");
|
||||||
let axiosConfig = {
|
let axiosConfig = {
|
||||||
headers: {
|
headers: {
|
||||||
@@ -40,7 +45,10 @@ class usersService {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
const endPoint = process.env.REACT_APP_USERS_ENDPOINT + uri;
|
const endPoint = process.env.REACT_APP_USERS_ENDPOINT + uri;
|
||||||
return Axios.get(endPoint,axiosConfig,reqData)
|
return Axios.get(endPoint,{
|
||||||
|
params: {
|
||||||
|
reqData
|
||||||
|
}})
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
console.log("~~~~~~~ Toks2 GET ~~~~~~~~");
|
console.log("~~~~~~~ Toks2 GET ~~~~~~~~");
|
||||||
return response;
|
return response;
|
||||||
|
|||||||
Reference in New Issue
Block a user