You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File names need to be consistent. Use camelCase or lowercase or kebab-case. Pick one!
All imports, function names, line spacing etc needs to be consistent. It's a real eye sore when it's not!
Eg:
import {addStoryApi } from '../apis/stories'
export const ADD_STORY ='ADD_STORY'
What does maori refer to throughout your code? The Te Reo place names? A person? A story?
Decide to use async await OR .then don't use a mix of methods. It makes reading code confusing when you have different code styles.
Remove all console.logs(). If using for errors, instead use console.error().
Remove all commented out code. Comments should only remain present in your main branch if they are useful for explaining the code. (Remove // Add a Story in api file, function name should explain this enough).
Either use api prefixes in all routes or use const rootUrl = '/api/v1/stories/' at the top of api files. Not both!
Seperate package and own imports at the top of your files. In App, you have blocks of mixed.
In Search.tsx, change the order of code inside the component to have variables and state before functions and then the return to be consistent with other components formatting.
Naming
In actions, what does fetchAddStory mean? Is it's purpose to get something from the backend or to post/add something to the backend.
In actions, you have an undefined function showError. Please remove or define.
In actions, what is the difference between addStory and addNewStory. Don't they do the same thing? Then pick one and use the same function in multiple places. Or clearly define how they are different.
In actions, some of your APIs are just called fetchStories and others are called fetchRegionsAPI should they all have API at the end or not?
in actions, all responses should be in the same format as regionsArr or be implied that plurals regions means an array of regions.
In reducers, you made variables for action names, so import those here instead of string text. This is the purpose for making them variables to start with, so when used in the reducer they match an actual action case too! :D
switch (type) {
case 'NAVIGATE':
return payload
Also, do you need redux to navigate? Don't you have routes doing that?
The text was updated successfully, but these errors were encountered:
Code Formatting
Eg:
maori
refer to throughout your code? The Te Reo place names? A person? A story?async await
OR.then
don't use a mix of methods. It makes reading code confusing when you have different code styles.console.logs()
. If using for errors, instead useconsole.error()
.// Add a Story
in api file, function name should explain this enough).const rootUrl = '/api/v1/stories/'
at the top of api files. Not both!Search.tsx
, change the order of code inside the component to have variables and state before functions and then the return to be consistent with other components formatting.Naming
fetchAddStory
mean? Is it's purpose to get something from the backend or topost
/add something to the backend.showError
. Please remove or define.addStory
andaddNewStory
. Don't they do the same thing? Then pick one and use the same function in multiple places. Or clearly define how they are different.fetchStories
and others are calledfetchRegionsAPI
should they all haveAPI
at the end or not?regionsArr
or be implied that pluralsregions
means an array of regions.The text was updated successfully, but these errors were encountered: