mirror of
https://github.com/glimpse-app/server.git
synced 2025-04-02 10:52:45 -04:00
return file count
This commit is contained in:
parent
d2b9c5f1d7
commit
9ff7f35912
1 changed files with 7 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
||||||
import std/[strutils, os, json]
|
import std/[strutils, os, json, with]
|
||||||
import jester
|
import jester
|
||||||
import norm/[model, postgres]
|
import norm/[model, postgres]
|
||||||
import ../types/[users, files]
|
import ../types/[users, files]
|
||||||
|
@ -53,4 +53,9 @@ proc createUploadRoutes*(cfg: Cfg) =
|
||||||
|
|
||||||
# write the file from memory
|
# write the file from memory
|
||||||
writeFile(filePath, fileData)
|
writeFile(filePath, fileData)
|
||||||
resp Http200, "[]\n", "application/json"
|
var userFileCount: string
|
||||||
|
with userFileCount:
|
||||||
|
add "[{"
|
||||||
|
add("\"fileCount\": \"" & $user.fileCount & "\"")
|
||||||
|
add "}]"
|
||||||
|
resp Http200, userFileCount & "\n", "application/json"
|
||||||
|
|
Loading…
Add table
Reference in a new issue