From d97973ab790b773ee1d041b38ea05e96b2789de9 Mon Sep 17 00:00:00 2001 From: Alina Beck Date: Mon, 2 Dec 2019 16:10:44 +0300 Subject: [PATCH] request faker images corresponding to set aspect ratios --- backend/src/seed/seed-db.js | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/backend/src/seed/seed-db.js b/backend/src/seed/seed-db.js index ad8828b81..944dca0c2 100644 --- a/backend/src/seed/seed-db.js +++ b/backend/src/seed/seed-db.js @@ -350,7 +350,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl'] author: peterLustig, id: 'p0', language: sample(languages), - image: faker.image.unsplash.food(), + image: faker.image.unsplash.food(300, 169), categoryIds: ['cat16'], imageAspectRatio: 1.777, }), @@ -358,7 +358,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl'] author: bobDerBaumeister, id: 'p1', language: sample(languages), - image: faker.image.unsplash.technology(), + image: faker.image.unsplash.technology(300, 1500), categoryIds: ['cat1'], imageAspectRatio: 0.2, }), @@ -367,27 +367,24 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl'] id: 'p3', language: sample(languages), categoryIds: ['cat3'], - imageAspectRatio: 0.5, }), factory.create('Post', { author: dewey, id: 'p4', language: sample(languages), categoryIds: ['cat4'], - imageAspectRatio: 0.75, }), factory.create('Post', { author: louie, id: 'p5', language: sample(languages), categoryIds: ['cat5'], - imageAspectRatio: 1, }), factory.create('Post', { authorId: 'u1', id: 'p6', language: sample(languages), - image: faker.image.unsplash.buildings(), + image: faker.image.unsplash.buildings(300, 857), categoryIds: ['cat6'], imageAspectRatio: 0.35, }), @@ -396,19 +393,17 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl'] id: 'p9', language: sample(languages), categoryIds: ['cat9'], - imageAspectRatio: 1.25, }), factory.create('Post', { author: dewey, id: 'p10', categoryIds: ['cat10'], - imageAspectRatio: 1.5, }), factory.create('Post', { author: louie, id: 'p11', language: sample(languages), - image: faker.image.unsplash.people(), + image: faker.image.unsplash.people(300, 901), categoryIds: ['cat11'], imageAspectRatio: 0.333, }), @@ -417,22 +412,20 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl'] id: 'p13', language: sample(languages), categoryIds: ['cat13'], - imageAspectRatio: 0.4, }), factory.create('Post', { author: jennyRostock, id: 'p14', language: sample(languages), - image: faker.image.unsplash.objects(), + image: faker.image.unsplash.objects(300, 200), categoryIds: ['cat14'], - imageAspectRatio: 0.5, + imageAspectRatio: 1.5, }), factory.create('Post', { author: huey, id: 'p15', language: sample(languages), categoryIds: ['cat15'], - imageAspectRatio: 0.8, }), ])