mirror of
https://github.com/mollersuite/monofile.git
synced 2024-11-22 13:56:27 -08:00
Update fileApiRoutes.ts
This commit is contained in:
parent
f4d7128e04
commit
6b6f05ea4c
|
@ -31,15 +31,16 @@ fileApiRoutes.get("/list", (req,res) => {
|
||||||
let acc = Accounts.getFromToken(req.cookies.auth)
|
let acc = Accounts.getFromToken(req.cookies.auth)
|
||||||
|
|
||||||
if (!acc) return
|
if (!acc) return
|
||||||
|
let accId = acc.id
|
||||||
|
|
||||||
res.send(acc.files.map((e) => {
|
res.send(acc.files.map((e) => {
|
||||||
let fp = files.getFilePointer(e)
|
let fp = files.getFilePointer(e)
|
||||||
|
if (!fp) { Accounts.files.deindex(accId, e); return null }
|
||||||
return {
|
return {
|
||||||
...fp,
|
...fp,
|
||||||
messageids: null,
|
messageids: null,
|
||||||
owner: null,
|
owner: null,
|
||||||
id:e,
|
id:e
|
||||||
sizeDisplay: fp.sizeInBytes ? bytes(fp.sizeInBytes) : "[File size unknown]"
|
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue