feat: validate preparation against owned document files
This commit is contained in:
@@ -250,11 +250,11 @@ export function addDocument(email, { ad, kategori, boyut, mime, dosya, sonKullan
|
||||
}
|
||||
|
||||
export function listDocuments(email, { ikn } = {}) {
|
||||
const alanlar = 'id, ad, kategori, boyut, mime, son_kullanma, ikn, olusturma';
|
||||
const alanlar = 'id, ad, kategori, boyut, mime, son_kullanma, ikn, olusturma, dosya';
|
||||
return withDb((db) => (ikn
|
||||
? db.prepare(`SELECT ${alanlar} FROM belgeler WHERE email=? AND ikn=? ORDER BY olusturma DESC`).all(email, ikn)
|
||||
: db.prepare(`SELECT ${alanlar} FROM belgeler WHERE email=? ORDER BY olusturma DESC`).all(email)
|
||||
), []);
|
||||
).map(({dosya,...record}) => ({...record, erisilebilir: fs.existsSync(path.join(BELGE_DIR,dosya))})), []);
|
||||
}
|
||||
|
||||
export function getDocument(email, id) {
|
||||
|
||||
Reference in New Issue
Block a user