mirror of
https://github.com/glimpse-app/server.git
synced 2025-04-02 10:52:45 -04:00
return filecount
This commit is contained in:
parent
9ff7f35912
commit
0dc5945583
1 changed files with 8 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
||||||
import std/[strutils, os, httpclient, strformat]
|
import std/[strutils, os, httpclient, strformat, with]
|
||||||
import jester
|
import jester
|
||||||
import norm/[model, postgres]
|
import norm/[model, postgres]
|
||||||
import ../types/[users, files]
|
import ../types/[users, files]
|
||||||
|
@ -68,7 +68,13 @@ proc createDeletionRoutes*(cfg: Cfg) =
|
||||||
db.delete(file)
|
db.delete(file)
|
||||||
dec user.fileCount
|
dec user.fileCount
|
||||||
db.update(user)
|
db.update(user)
|
||||||
resp Http200, "[]\n", "application/json"
|
|
||||||
|
var userFileCount: string
|
||||||
|
with userFileCount:
|
||||||
|
add "[{"
|
||||||
|
add("\"fileCount\": \"" & $user.fileCount & "\"")
|
||||||
|
add "}]"
|
||||||
|
resp Http200, userFileCount & "\n", "application/json"
|
||||||
|
|
||||||
#[
|
#[
|
||||||
request parameters:
|
request parameters:
|
||||||
|
|
Loading…
Add table
Reference in a new issue