Skip to content

Modif Exo3 KIS #4

Open
axelvuillaume wants to merge 5 commits into
selego:mainfrom
axelvuillaume:KIS
Open

Modif Exo3 KIS #4
axelvuillaume wants to merge 5 commits into
selego:mainfrom
axelvuillaume:KIS

Conversation

@axelvuillaume

Copy link
Copy Markdown

No description provided.

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

Copy link
Copy Markdown

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}

Comment thread exercises/kis.js
const fetchUserData = useCallback(async () => {


const fetchUserResponse = async (userId) => {

Copy link
Copy Markdown

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

Comment thread exercises/kis.js
averageSpend: averageSpend.toFixed(2),
topCategory,
userTier: user?.totalSpent > 10000 ? 'Platinum' : user?.totalSpent > 5000 ? 'Gold' : 'Silver'
userTier,

Copy link
Copy Markdown

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