ConusAI vendor v0.1.0-dev.20261013+85463d22
This commit is contained in:
parent
c3c6526952
commit
0da8a2a81b
@@ -23,6 +23,16 @@ export function fileRepository(db: Db) {
|
||||
return db.select().from(files).where(eq(files.noteId, noteId))
|
||||
},
|
||||
|
||||
/** The attachment, or `undefined` when `authorId` did not attach it. */
|
||||
async get(id: string, authorId: string): Promise<FileRow | undefined> {
|
||||
const [row] = await db
|
||||
.select()
|
||||
.from(files)
|
||||
.where(and(eq(files.id, id), eq(files.authorId, authorId)))
|
||||
.limit(1)
|
||||
return row
|
||||
},
|
||||
|
||||
/** Every attachment the visitor made, across their notes. */
|
||||
async listByAuthor(authorId: string): Promise<FileRow[]> {
|
||||
return db.select().from(files).where(eq(files.authorId, authorId))
|
||||
|
||||
Reference in New Issue
Block a user