Open PaulPatterson48 opened 11 months ago
GIVEN: As an authenticated user, I should be able to see the Team view with all the members I created
Google authentication limited to only the users associated with the login user
utils\auth.js
/ eslint-disable react-hooks/exhaustive-deps / import React, { useEffect, useState } from 'react'; import Link from 'next/link'; import { Button } from 'react-bootstrap'; import { getBooks } from '../api/bookData'; import { useAuth } from '../utils/context/authContext'; import BookCard from '../components/BookCard';
function ShowBooks() { // TODO: Set a state for books const [books, setBooks] = useState([]);
// TODO: Get user ID using useAuth Hook const { user } = useAuth();
// TODO: create a function that makes the API call to get all the books const getAllTheBooks = () => { getBooks(user.uid).then(setBooks); };
// TODO: make the call to the API to get all the books on component render useEffect(() => { getAllTheBooks(); }, []);
return (
); }
export default ShowBooks;
User Story
GIVEN: As an authenticated user, I should be able to see the Team view with all the members I created
Acceptance Criteria
Google authentication limited to only the users associated with the login user
Dependecies
utils\auth.js
Dev Notes
/ eslint-disable react-hooks/exhaustive-deps / import React, { useEffect, useState } from 'react'; import Link from 'next/link'; import { Button } from 'react-bootstrap'; import { getBooks } from '../api/bookData'; import { useAuth } from '../utils/context/authContext'; import BookCard from '../components/BookCard';
function ShowBooks() { // TODO: Set a state for books const [books, setBooks] = useState([]);
// TODO: Get user ID using useAuth Hook const { user } = useAuth();
// TODO: create a function that makes the API call to get all the books const getAllTheBooks = () => { getBooks(user.uid).then(setBooks); };
// TODO: make the call to the API to get all the books on component render useEffect(() => { getAllTheBooks(); }, []);
return (
); }
export default ShowBooks;