Skip to content

Populates DB with Pokemon#10

Open
koggenfuss wants to merge 20 commits intocode-differently:mainfrom
koggenfuss:main
Open

Populates DB with Pokemon#10
koggenfuss wants to merge 20 commits intocode-differently:mainfrom
koggenfuss:main

Conversation

@koggenfuss
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown
Contributor

@kburd kburd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Make the couple changes i suggested and it'll be done!

data/schema.sql Outdated
FOREIGN KEY (typeID) REFERENCES pokeType (typeID)
);

INSERT INTO
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We generally don't include insertion statements in our schema, just database and table creation

rest/index.js Outdated
app.get("/customers", async(req, res) => {
let customerData = await getCustomerData();
res.send(customerData);
});
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getCustomerData() no longer exists in your code so you can remove this endpoint

var P = new Pokedex();

const app = express();
const port = 3000;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove express here. We only use express when we want to trigger logic or retrieve data. Here we could just run the script, no need to expose it through express. The core logic looks good though

.then (console.log("IN SCRIPT.JS FILE"))
.then (pokemon => {
pokemon.map(pokemon => `<div>${pokemon.name} ${pokemon.id}</div>`).join("")
})
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You generate the html correct, just need to use the dom to render it on the webpage now

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