ConusAI vendor 81941888f
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
'use server'
|
||||
|
||||
import { noteRepository } from '@/entities/note'
|
||||
import { db } from '@/shared/api'
|
||||
import { exportToS3 } from '@/shared/lib/optional'
|
||||
import { ensureVisitor } from '@/shared/lib/visitor-session'
|
||||
|
||||
/** Writes the visitor's notes to the S3 bucket as one JSON object (S3 module). */
|
||||
export async function exportNotes(): Promise<void> {
|
||||
const actor = await ensureVisitor()
|
||||
const notes = await noteRepository(db()).listByAuthor(actor)
|
||||
await exportToS3(actor, notes)
|
||||
}
|
||||
Reference in New Issue
Block a user