wants wip"

This commit is contained in:
ntr committed 2022-08-16 10:09:36 +10:00
1 parent c99f6fd2b6
commit f5e75f4fe6
7 files changed
+33 -12

No files matched your search

+1 -1
View File
@@ -24,7 +24,7 @@ const User = () => {
const [noResults, setNoResults] = useState(false);
async function fetchResults() {
const { data } = await axios.post(`http://localhost:41337/want/search`, {
const { data } = await axios.post(`http://localhost:41337/wants/search`, {
artist,
title,
});
+9 -4
View File
@@ -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) {