Add hashnode support for posts plugin and additional options (#165)
This commit is contained in:
23
source/app/mocks/api/axios/post/hashnode.mjs
Normal file
23
source/app/mocks/api/axios/post/hashnode.mjs
Normal file
@@ -0,0 +1,23 @@
|
||||
/**Mocked data */
|
||||
export default function({faker, url, body, login = faker.internet.userName()}) {
|
||||
if (/^https:..api.hashnode.com.*$/.test(url)) {
|
||||
console.debug(`metrics/compute/mocks > mocking hashnode result > ${url}`)
|
||||
return ({
|
||||
status:200,
|
||||
data:{
|
||||
data:{
|
||||
user:{
|
||||
publication:{
|
||||
posts:new Array(30).fill(null).map(_ => ({
|
||||
title:faker.lorem.sentence(),
|
||||
brief:faker.lorem.paragraph(),
|
||||
coverImage:null,
|
||||
dateAdded:faker.date.recent(),
|
||||
})),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user