deleted or disabled post are not available for user data download.

This commit is contained in:
Moriz Wahl 2020-10-16 11:00:58 +02:00
parent f9518619fe
commit 14de48ecd7
2 changed files with 6 additions and 13 deletions

View File

@ -6,8 +6,10 @@ export default {
MATCH (user:User { id: $id })
WITH user
OPTIONAL MATCH (p:Post)
WHERE (p)<-[:COMMENTS]-(:Comment)<-[:WROTE]-(user)
OR (user)-[:WROTE]->(p)
WHERE ((p)<-[:COMMENTS]-(:Comment)<-[:WROTE]-(user)
OR (user)-[:WROTE]->(p))
AND p.deleted = FALSE
AND p.disabled = FALSE
RETURN { user: properties(user), posts: collect(properties(p)) }
AS result
`

View File

@ -8,7 +8,7 @@
<ds-text>{{ $t('settings.download.description') }}</ds-text>
<ds-space margin="large" />
<base-card v-for="image in imageList" :key="image.key">
<a :href="image.url" @click.prevent="downloadImage(image)">{{ image.title }}</a>
<a :href="image.url" target="_blank" rel="noopener noreferrer">{{ image.title }}</a>
<ds-space margin="xxx-small" />
</base-card>
</base-card>
@ -48,16 +48,6 @@ export default {
document.body.appendChild(fileLink)
fileLink.click()
},
downloadImage({ url }) {
this.$axios.get(url, { responseType: 'blob' }).then((response) => {
const blob = new Blob([response.data])
const link = document.createElement('a')
link.href = URL.createObjectURL(blob)
link.download = url.replace(/^.+\//g, '')
link.click()
URL.revokeObjectURL(link.href)
})
},
},
apollo: {
queryUserData: {
@ -83,6 +73,7 @@ export default {
return obj
})
},
fetchPolicy: 'cache-and-network',
},
},
}