return filecount

This commit is contained in:
array-in-a-matrix 2024-08-07 20:32:19 -04:00
parent 9ff7f35912
commit 0dc5945583

View file

@ -1,4 +1,4 @@
import std/[strutils, os, httpclient, strformat]
import std/[strutils, os, httpclient, strformat, with]
import jester
import norm/[model, postgres]
import ../types/[users, files]
@ -68,7 +68,13 @@ proc createDeletionRoutes*(cfg: Cfg) =
db.delete(file)
dec user.fileCount
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: