diff --git a/backend/tsconfig.json b/backend/tsconfig.json index 0557b5b..eeebc72 100644 --- a/backend/tsconfig.json +++ b/backend/tsconfig.json @@ -1,18 +1,16 @@ { - "compilerOptions": { - "lib": [ - "es6" - ], - "target": "es6", - "module": "ESNext", - "moduleResolution": "node", - "outDir": "dist", - "resolveJsonModule": true, - "emitDecoratorMetadata": true, - "esModuleInterop": true, - "experimentalDecorators": true, - "sourceMap": true - }, - "include": ["**/*.ts"], - "exclude": ["node_modules", "**/*.spec.ts"] - } \ No newline at end of file + "compilerOptions": { + "lib": ["es6"], + "target": "es6", + "module": "ESNext", + "moduleResolution": "node", + "outDir": "dist", + "resolveJsonModule": true, + "emitDecoratorMetadata": true, + "esModuleInterop": true, + "experimentalDecorators": true, + "sourceMap": true + }, + "include": ["**/*.ts"], + "exclude": ["node_modules", "**/*.spec.ts"] +} diff --git a/frontend/lib/edits.tsx b/frontend/lib/edits.tsx index 38c2097..4399a0b 100644 --- a/frontend/lib/edits.tsx +++ b/frontend/lib/edits.tsx @@ -124,7 +124,7 @@ export const moveItem = async ( body: JSON.stringify({ items: newBasketsItems, }), - } + }, ); if (removeItemFromBasket.ok) { console.log("Item removed from basket successfully"); diff --git a/frontend/lib/fetches.tsx b/frontend/lib/fetches.tsx index 19e64ba..b35beb7 100644 --- a/frontend/lib/fetches.tsx +++ b/frontend/lib/fetches.tsx @@ -30,7 +30,6 @@ export const fetchGroupById = async (groupId: string) => { Authorization: `Bearer ${localStorage.getItem("token")}`, }, }); - if (res.ok) { return res.json(); } else { @@ -72,7 +71,6 @@ export const fetchUserGroupsByUser = async (user: IUser) => { Authorization: `Bearer ${localStorage.getItem("token")}`, }, }); - if (res.status === 200) { const data = await res.json(); return data; @@ -90,7 +88,6 @@ export const fetchUserFriendsByUser = async (user: IUser) => { Authorization: `Bearer ${localStorage.getItem("token")}`, }, }); - if (res.status === 200) { const data = await res.json(); return data; @@ -148,7 +145,6 @@ export const fetchGroupBaskets = async (group: IGroup) => { Authorization: `Bearer ${localStorage.getItem("token")}`, }, }); - if (res.status === 200) { const data = await res.json(); return data; @@ -171,7 +167,6 @@ export const fetchBasketItems = async (basket: IBasket) => { Authorization: `Bearer ${localStorage.getItem("token")}`, }, }); - if (res.status === 200) { const data = await res.json(); return data; @@ -188,7 +183,6 @@ export const fetchUserBaskets = async (userId: string) => { Authorization: `Bearer ${localStorage.getItem("token")}`, }, }); - if (res.status === 200) { const allBaskets = await res.json(); const userBaskets = [] as IBasket[]; @@ -209,7 +203,6 @@ export const fetchGroups = async (userGroups: ObjectId[]) => { Authorization: `Bearer ${localStorage.getItem("token")}`, }, }); - if (res.status === 200) { const data = await res.json(); return data; @@ -229,7 +222,6 @@ export const fetchMembers = async (memberIds: ObjectId[]) => { Authorization: `Bearer ${localStorage.getItem("token")}`, }, }); - if (res.ok) { return res.json(); } else { diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 56da0d4..10fe446 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -72,7 +72,7 @@ function App() { updateState={{ setUser, setToken }} /> ) : ( - + )} } /> @@ -92,9 +92,7 @@ function App() { + } /> } /> - diff --git a/frontend/src/components/ItemGroup.tsx b/frontend/src/components/ItemGroup.tsx index 677a9d3..083d109 100644 --- a/frontend/src/components/ItemGroup.tsx +++ b/frontend/src/components/ItemGroup.tsx @@ -144,47 +144,51 @@ const ItemGroup: React.FC = ({ {!loading && items.length > 0 ? ( - items.map((item, index) => ( - console.log(item), - - {item.name} - {item.notes} - - - - - - }> - Select Basket - - - {userBaskets.length > 0 ? ( - (console.log(userBaskets), - userBaskets.map((basket) => ( - handleMove(basket, item)} - _hover={{ textColor: "black" }} - > - {basket.basketName} - - ))) - ) : ( - No baskets available - )} - - - - - } - colorScheme="red" - onClick={() => removeItem(item)} - /> - - - )) + items.map( + (item, index) => ( + console.log(item), + ( + + {item.name} + {item.notes} + + + + + + }> + Select Basket + + + {userBaskets.length > 0 ? ( + (console.log(userBaskets), + userBaskets.map((basket) => ( + handleMove(basket, item)} + _hover={{ textColor: "black" }} + > + {basket.basketName} + + ))) + ) : ( + No baskets available + )} + + + + + } + colorScheme="red" + onClick={() => removeItem(item)} + /> + + + ) + ), + ) ) : ( No items found. diff --git a/frontend/src/pages/MyGroupsPage.tsx b/frontend/src/pages/MyGroupsPage.tsx index a1d4f55..3d34ef8 100644 --- a/frontend/src/pages/MyGroupsPage.tsx +++ b/frontend/src/pages/MyGroupsPage.tsx @@ -162,7 +162,8 @@ const GroupPage: React.FC = ({ justifyContent="center" alignItems="center" > - {stateVariable.user?.groups.length !== 0 && filteredGroups.length === 0 ? ( + {stateVariable.user?.groups.length !== 0 && + filteredGroups.length === 0 ? ( skelIds.map((id) => { return ( @@ -198,9 +199,7 @@ const GroupPage: React.FC = ({ }) ) : ( - - No groups found! Do you want to add one? - + No groups found! Do you want to add one? )} diff --git a/frontend/src/pages/ProfilePage.tsx b/frontend/src/pages/ProfilePage.tsx index a7c3551..c293fbc 100644 --- a/frontend/src/pages/ProfilePage.tsx +++ b/frontend/src/pages/ProfilePage.tsx @@ -8,16 +8,13 @@ interface ProfilePageProps { LoggedInUser: string; } -const ProfilePage: React.FC = ({ - LoggedInUser, -}) => { +const ProfilePage: React.FC = ({ LoggedInUser }) => { const navigate = useNavigate(); useEffect(() => { if (!localStorage.getItem("token")) { navigate("/login"); } - } - ); + }); return ( @@ -27,7 +24,7 @@ const ProfilePage: React.FC = ({ justifyContent={"space-between"} > - +