Skip to content

Conversation

axelvuillaume
Copy link

No description provided.

const fetchTransactionsResponse = async (userId) => {
try {
setIsLoading(true);
const {ok,data} = await api.get(`/api/transactions?userId=${userId}`);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ça serait comme ça qu'on devrait appeler le get : /api/transactions/${userId}

const fetchUserData = useCallback(async () => {


const fetchUserResponse = async (userId) => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pas besoin de userId ici il est déjà dans le paramètre du composant parent

averageSpend: averageSpend.toFixed(2),
topCategory,
userTier: user?.totalSpent > 10000 ? 'Platinum' : user?.totalSpent > 5000 ? 'Gold' : 'Silver'
userTier,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ton const ici n'est pas bon, il faudrait que les calculs soit appelé à un moment donné

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants