This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // ------------App Component ------------------------ | |
| import React, { useState } from "react"; | |
| import ClickTimes from "./ClickTimes"; | |
| import TimestampsDisplay from "./TimestampsDisplay"; | |
| function App() { | |
| // this line is creating some state "stuff" | |
| // it makes a variable called timestamps and initializes it to an empty array | |
| // it also creates a function setTimestamps that will allow us to update the | |
| // variable timestamps | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | const webhookCallbackUrl = `${process.env.SIGN_NOW_WEBHOOK_CALLBACK_URL}/api/sign-now/${dataType}/${dataItemId}/pdf`; | |
| // create document signed webhook | |
| await createSigningCompleteWebhook(authToken, documentId, webhookCallbackUrl); | |
| // create signing declined webhook | |
| await createSigningDeclinedWebhook( | |
| signNowApi, | |
| authToken, | |
| documentId, | |
| webhookCallbackUrl | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | function showHelpOptions(optionsArray) { | |
| let optionString = "Enter a keyword for help with a topic: " | |
| optionString += optionsArray.join(', ') | |
| optionString += '.' | |
| return optionString; | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import React from "react"; | |
| import Header from "./Header"; | |
| import HobbyList from "./HobbyList"; | |
| import Activity from "./Activity"; | |
| function App() { | |
| const name = "Kitty Kat"; | |
| const birthday = "January 1"; | |
| const imageSrc = | |
| "https://images.pexels.com/photos/45201/kitty-cat-kitten-pet-45201.jpeg"; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import React from "react"; | |
| import "./HobbyList.css"; | |
| function HobbyList(props) { | |
| const { hobbies } = props; | |
| const listItems = hobbies.map((hobby, index) => <li key={index}>{hobby}</li>); | |
| if (listItems.length > 0) { | |
| return ( | |
| <div> | |
| <h4>Hobbies</h4> | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | const create = (req, res) => { | |
| const knex = req.app.get("db"); | |
| const newScience = { | |
| name: req.body.name, | |
| description: req.body.description, | |
| } | |
| knex("sciences") | |
| .insert(newScience) | |
| .returning("*") | |
| .then((createdRecords) => createdRecords[0]) | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | const create = (req, res) => { | |
| const knex = req.app.get("db"); | |
| const newScience = { | |
| name: req.body.name, | |
| description: req.body.description, | |
| } | |
| knex("sciences") | |
| .insert(newScience).returning("*") | |
| .then((createdRecords) => { | |
| const newRecord = createdRecords[0]; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import React, { useEffect, useState } from "react"; | |
| import PostDetail from "./PostDetail"; | |
| function App() { | |
| const [posts, setPosts] = useState([]); | |
| const [comments, setComments] = useState([]); | |
| const [currentId, setCurrentId] = useState(1); | |
| const onClickPost = async (post) => { | |
| console.log('POST CLICKED'); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | function getMostPopularAuthors(books, authors) { | |
| // we are going to use reduce to get an array of objects that have | |
| const authorList = books.reduce((acc, book) => { | |
| // grab the authorId and borrows array | |
| const { authorId, borrows } = book; | |
| // get the authorObj | |
| const authorObj = authors.find(author => author.id === authorId); | |
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // TODO: return an array of users from /users in form of { data: Array } | |
| app.use('/users', (req, res, next) => { | |
| // we don't need to get anything from the request | |
| // because this endpoint just automatically returns | |
| // the list of users | |
| // const { users } = req.params | |
| // it wants the response data to look like this | |
| // an object with a 'data' property that contains the user list | |
| const response = { |