mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Delete post.image
In contrast to the other errors, it's better to send `null` for an image. That way, the browser won't even try to load that url.
This commit is contained in:
parent
99dd6ea20a
commit
2a544376a3
@ -19,10 +19,10 @@ const obfuscate = async (resolve, root, args, context, info) => {
|
||||
root.contentExcerpt = 'UNAVAILABLE'
|
||||
root.title = 'UNAVAILABLE'
|
||||
root.slug = 'UNAVAILABLE'
|
||||
root.image = 'UNAVAILABLE'
|
||||
root.avatar = 'UNAVAILABLE'
|
||||
root.about = 'UNAVAILABLE'
|
||||
root.name = 'UNAVAILABLE'
|
||||
root.image = null // avoid unecessary 500 errors
|
||||
}
|
||||
return resolve(root, args, context, info)
|
||||
}
|
||||
|
||||
@ -240,7 +240,7 @@ describe('softDeleteMiddleware', () => {
|
||||
it('obfuscates slug', () => expect(subject.slug).toEqual('UNAVAILABLE'))
|
||||
it('obfuscates content', () => expect(subject.content).toEqual('UNAVAILABLE'))
|
||||
it('obfuscates contentExcerpt', () => expect(subject.contentExcerpt).toEqual('UNAVAILABLE'))
|
||||
it('obfuscates image', () => expect(subject.image).toEqual('UNAVAILABLE'))
|
||||
it('obfuscates image', () => expect(subject.image).toEqual(null))
|
||||
})
|
||||
|
||||
describe('Comment', () => {
|
||||
|
||||
@ -149,11 +149,11 @@ export default {
|
||||
MATCH (post:Post {id: $postId})
|
||||
OPTIONAL MATCH (post)<-[:COMMENTS]-(comment:Comment)
|
||||
SET post.deleted = TRUE
|
||||
SET post.image = 'UNAVAILABLE'
|
||||
SET post.content = 'UNAVAILABLE'
|
||||
SET post.contentExcerpt = 'UNAVAILABLE'
|
||||
SET post.title = 'UNAVAILABLE'
|
||||
SET comment.deleted = TRUE
|
||||
REMOVE post.image
|
||||
RETURN post
|
||||
`,
|
||||
{ postId: args.id },
|
||||
|
||||
@ -470,7 +470,7 @@ describe('DeletePost', () => {
|
||||
deleted: true,
|
||||
content: 'UNAVAILABLE',
|
||||
contentExcerpt: 'UNAVAILABLE',
|
||||
image: 'UNAVAILABLE',
|
||||
image: null,
|
||||
comments: [],
|
||||
},
|
||||
},
|
||||
@ -497,7 +497,7 @@ describe('DeletePost', () => {
|
||||
deleted: true,
|
||||
content: 'UNAVAILABLE',
|
||||
contentExcerpt: 'UNAVAILABLE',
|
||||
image: 'UNAVAILABLE',
|
||||
image: null,
|
||||
comments: [
|
||||
{
|
||||
deleted: true,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user