kevin/reviews-page #33

Merged
fr merged 10 commits from kevin/reviews-page into main 2024-05-15 02:54:09 +02:00
2 changed files with 12 additions and 6 deletions
Showing only changes of commit 2041c8998a - Show all commits

View File

@ -43,7 +43,7 @@ export default function reviewAdd() {
),
},
{
label: "Excelent",
label: "Excellent",
value: "3",
icon: () => (
<Image
@ -78,7 +78,7 @@ export default function reviewAdd() {
),
},
{
label: "Excelent",
label: "Excellent",
value: "3",
icon: () => (
<Image
@ -133,7 +133,7 @@ export default function reviewAdd() {
),
},
{
label: "Excelent!",
label: "Excellent!",
value: "5",
icon: () => (
<Image
@ -188,7 +188,7 @@ export default function reviewAdd() {
),
},
{
label: "Excelent!",
label: "Excellent!",
value: "5",
icon: () => (
<Image

View File

@ -4,8 +4,11 @@ import Button from "@components/Button";
import { colors } from "@components/style";
import { router } from "expo-router";
import { useEffect, useState } from "react";
import { useAuth } from "@context/AuthContext";
export default function Tab() {
const { authState } = useAuth();
const user = authState.user;
const [data, setData] = useState([]);
useEffect(() => {
fetchData();
@ -17,8 +20,11 @@ export default function Tab() {
method: "GET",
credentials: "include",
});
const data = await res.json();
setData(data.data);
let data = await res.json();
// show only logged in user's data
data = data.data.filter((review) => review.user_id == user._id);
console.log("reviews", data);
setData(data);
} catch (err) {
console.error(err);
alert("Something went wrong");