adapt backend image faking due to deprecation warning

This commit is contained in:
mahula 2024-04-29 17:48:41 +02:00
parent 7b3ed63bc9
commit 6cecd3662f
2 changed files with 13 additions and 13 deletions

View File

@ -2,7 +2,7 @@ import { v4 as uuid } from 'uuid'
import slugify from 'slug' import slugify from 'slug'
import { hashSync } from 'bcryptjs' import { hashSync } from 'bcryptjs'
import { Factory } from 'rosie' import { Factory } from 'rosie'
import { faker } from '@faker-js/faker' import { faker } from '@faker-js/faker'
import { getDriver, getNeode } from './neo4j' import { getDriver, getNeode } from './neo4j'
import CONFIG from '../config/index' import CONFIG from '../config/index'
import generateInviteCode from '../schema/resolvers/helpers/generateInviteCode' import generateInviteCode from '../schema/resolvers/helpers/generateInviteCode'

View File

@ -632,7 +632,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl']
categoryIds: ['cat16'], categoryIds: ['cat16'],
author: peterLustig, author: peterLustig,
image: Factory.build('image', { image: Factory.build('image', {
url: faker.image.unsplash.food(300, 169), url: faker.image.urlLoremFlickr({ category: 'food', width: 300, height: 169 }),
sensitive: true, sensitive: true,
aspectRatio: 300 / 169, aspectRatio: 300 / 169,
}), }),
@ -648,7 +648,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl']
categoryIds: ['cat1'], categoryIds: ['cat1'],
author: bobDerBaumeister, author: bobDerBaumeister,
image: Factory.build('image', { image: Factory.build('image', {
url: faker.image.unsplash.technology(300, 1500), url: faker.image.urlLoremFlickr({ category: 'technics', width: 300, height: 1500 }),
aspectRatio: 300 / 1500, aspectRatio: 300 / 1500,
}), }),
}, },
@ -696,7 +696,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl']
categoryIds: ['cat6'], categoryIds: ['cat6'],
author: peterLustig, author: peterLustig,
image: Factory.build('image', { image: Factory.build('image', {
url: faker.image.unsplash.buildings(300, 857), url: faker.image.urlLoremFlickr({ category: 'city', width: 300, height: 857 }),
aspectRatio: 300 / 857, aspectRatio: 300 / 857,
}), }),
}, },
@ -735,7 +735,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl']
categoryIds: ['cat11'], categoryIds: ['cat11'],
author: louie, author: louie,
image: Factory.build('image', { image: Factory.build('image', {
url: faker.image.unsplash.people(300, 901), url: faker.image.urlLoremFlickr({ category: 'people', width: 300, height: 901 }),
aspectRatio: 300 / 901, aspectRatio: 300 / 901,
}), }),
}, },
@ -761,7 +761,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl']
categoryIds: ['cat14'], categoryIds: ['cat14'],
author: jennyRostock, author: jennyRostock,
image: Factory.build('image', { image: Factory.build('image', {
url: faker.image.unsplash.objects(300, 200), url: faker.image.urlLoremFlickr({ category: 'abstract', width: 300, height: 200 }),
aspectRatio: 300 / 450, aspectRatio: 300 / 450,
}), }),
}, },
@ -821,7 +821,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl']
mutation: createPostMutation(), mutation: createPostMutation(),
variables: { variables: {
id: 'p8', id: 'p8',
image: faker.image.unsplash.nature(), image: faker.image.urlLoremFlickr({ category: 'nature' }),
title: `Quantum Flow Theory explains Quantum Gravity`, title: `Quantum Flow Theory explains Quantum Gravity`,
content: hashtagAndMention1, content: hashtagAndMention1,
categoryIds: ['cat8'], categoryIds: ['cat8'],
@ -1178,7 +1178,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl']
categoryIds: ['cat1'], categoryIds: ['cat1'],
author: jennyRostock, author: jennyRostock,
image: Factory.build('image', { image: Factory.build('image', {
url: faker.image.unsplash.objects(), url: faker.image.urlLoremFlickr({ category: 'abstract' }),
}), }),
}, },
) )
@ -1229,7 +1229,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl']
categoryIds: ['cat1'], categoryIds: ['cat1'],
author: peterLustig, author: peterLustig,
image: Factory.build('image', { image: Factory.build('image', {
url: faker.image.unsplash.buildings(), url: faker.image.urlLoremFlickr({ category: 'city' }),
}), }),
}, },
) )
@ -1280,7 +1280,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl']
categoryIds: ['cat1'], categoryIds: ['cat1'],
author: dewey, author: dewey,
image: Factory.build('image', { image: Factory.build('image', {
url: faker.image.unsplash.food(), url: faker.image.urlLoremFlickr({ category: 'food' }),
}), }),
}, },
) )
@ -1331,7 +1331,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl']
categoryIds: ['cat1'], categoryIds: ['cat1'],
author: louie, author: louie,
image: Factory.build('image', { image: Factory.build('image', {
url: faker.image.unsplash.technology(), url: faker.image.urlLoremFlickr({ category: 'technics' }),
}), }),
}, },
) )
@ -1382,7 +1382,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl']
categoryIds: ['cat1'], categoryIds: ['cat1'],
author: bobDerBaumeister, author: bobDerBaumeister,
image: Factory.build('image', { image: Factory.build('image', {
url: faker.image.unsplash.people(), url: faker.image.urlLoremFlickr({ category: 'people' }),
}), }),
}, },
) )
@ -1433,7 +1433,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl']
categoryIds: ['cat1'], categoryIds: ['cat1'],
author: huey, author: huey,
image: Factory.build('image', { image: Factory.build('image', {
url: faker.image.unsplash.nature(), url: faker.image.urlLoremFlickr({ category: 'nature' }),
}), }),
}, },
) )