Update brewery/beer style to use tuples for ranges/coords. Seed updates.

This commit is contained in:
Aaron William Po
2023-09-22 02:17:05 -04:00
parent e95cb29189
commit 43220fe0e6
11 changed files with 37 additions and 17 deletions

View File

@@ -38,8 +38,12 @@ const createNewBeerPosts = async ({
const breweryPost = breweryPosts[Math.floor(Math.random() * breweryPosts.length)];
const createdAt = faker.date.past({ years: 1 });
const abv = Math.floor(Math.random() * (12 - 4) + 4);
const ibu = Math.floor(Math.random() * (60 - 10) + 10);
const [minABV, maxABV] = beerStyle.abvRange;
const [minIBU, maxIBU] = beerStyle.ibuRange;
const abv = parseFloat((Math.random() * (maxABV - minABV) + minABV).toFixed(1));
const ibu = Math.floor(Math.random() * (maxIBU - minIBU) + minIBU);
const name = faker.commerce.productName();
const description = faker.lorem.lines(20).replace(/(\r\n|\n|\r)/gm, ' ');