wants wip"
This commit is contained in:
1 parent
c99f6fd2b6
commit
f5e75f4fe6
7 files changed
+33
-12
No files matched your search
@@ -6,17 +6,22 @@ import actions from './../actions';
|
||||
import Bundle from './../components/bundle';
|
||||
|
||||
interface Props {
|
||||
userId: string,
|
||||
user: any,
|
||||
offers: any[],
|
||||
getUserOffers: (userId: string) => void,
|
||||
}
|
||||
|
||||
const User = ({ userId }: Props) => {
|
||||
const User = ({ user }: Props) => {
|
||||
const [offers, setOffers] = useState([]);
|
||||
|
||||
useEffect(() => {
|
||||
actions.getOffers(userId).then(setOffers);
|
||||
}, [userId]);
|
||||
async function getWants() {
|
||||
const [error, wants] = await actions.getWants();
|
||||
if (error) return console.error(error);
|
||||
setOffers(wants);
|
||||
}
|
||||
getWants();
|
||||
}, []);
|
||||
|
||||
|
||||
if (!offers.length) {
|
||||
|
||||
Reference in new issue
Block a user