Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion frontend/src/app/data-export/data-export.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,15 @@ export class DataExportComponent implements OnInit {
this.error = null
this.confirmation = data.confirmation
this.userData = data.userData
window.open('', '_blank', 'width=500')?.document.write(this.userData)
const blob = new Blob([this.userData], { type: 'application/json' })
const url = URL.createObjectURL(blob)
const a = document.createElement('a')
a.href = url
a.download = 'data-export.json'
document.body.appendChild(a)
a.click()
document.body.removeChild(a)
URL.revokeObjectURL(url)
this.lastSuccessfulTry = new Date()
localStorage.setItem('lstdtxprt', JSON.stringify(this.lastSuccessfulTry))
this.ngOnInit()
Expand Down
2 changes: 1 addition & 1 deletion routes/dataExport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export function dataExport () {
likesCount: number
likedBy: string
}) => ({
message: review.message,
message: security.sanitizeSecure(review.message),
author: review.author,
productId: review.product,
likesCount: review.likesCount,
Expand Down