mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-12 23:35:58 +00:00
adapt name and random faking to updates faker api
This commit is contained in:
parent
d8e47238bb
commit
47d79544c6
@ -8,7 +8,7 @@ helpers.init()
|
||||
|
||||
const commentMock = (fields) => {
|
||||
return {
|
||||
id: faker.random.uuid(),
|
||||
id: faker.string.uuid(),
|
||||
title: faker.lorem.sentence(),
|
||||
content: faker.lorem.paragraph(),
|
||||
createdAt: faker.date.past(),
|
||||
|
||||
@ -17,7 +17,7 @@ helpers.init()
|
||||
const postMock = (fields) => {
|
||||
return {
|
||||
...post,
|
||||
id: faker.random.uuid(),
|
||||
id: faker.string.uuid(),
|
||||
createdAt: faker.date.past(),
|
||||
updatedAt: faker.date.recent(),
|
||||
deleted: false,
|
||||
@ -30,7 +30,7 @@ const postMock = (fields) => {
|
||||
const userMock = (fields) => {
|
||||
return {
|
||||
...user,
|
||||
id: faker.random.uuid(),
|
||||
id: faker.string.uuid(),
|
||||
createdAt: faker.date.past(),
|
||||
updatedAt: faker.date.recent(),
|
||||
deleted: false,
|
||||
|
||||
@ -61,9 +61,9 @@ const helpers = {
|
||||
},
|
||||
fakeUser(n) {
|
||||
return new Array(n || 1).fill(0).map(() => {
|
||||
const name = faker.name.findName()
|
||||
const name = faker.person.person.fullName()
|
||||
return {
|
||||
id: faker.random.uuid(),
|
||||
id: faker.string.uuid(),
|
||||
name,
|
||||
slug: faker.helpers.slugify(name),
|
||||
}
|
||||
@ -74,14 +74,14 @@ const helpers = {
|
||||
const title = faker.lorem.words()
|
||||
const content = faker.lorem.paragraph()
|
||||
return {
|
||||
id: faker.random.uuid(),
|
||||
id: faker.string.uuid(),
|
||||
title,
|
||||
content,
|
||||
slug: faker.lorem.slug(title),
|
||||
shoutedCount: faker.random.number(),
|
||||
commentsCount: faker.random.number(),
|
||||
clickedCount: faker.random.number(),
|
||||
viewedTeaserCount: faker.random.number(),
|
||||
shoutedCount: faker.number.int(),
|
||||
commentsCount: faker.number.int(),
|
||||
clickedCount: faker.number.int(),
|
||||
viewedTeaserCount: faker.number.int(),
|
||||
postType: ['Article'],
|
||||
}
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user