return JSON with updated file info

This commit is contained in:
array-in-a-matrix 2024-07-24 19:26:36 -04:00
parent e366c3b6e6
commit 6c10a78dfe

View file

@ -1,4 +1,4 @@
import std/[strutils, os]
import std/[strutils, os, with]
import jester
import norm/postgres
import ../types/[users, files]
@ -50,4 +50,13 @@ proc createUpdateRoutes*() =
file.path = newPath
file.name = newName
db.update(file)
resp Http200, "[{}]\n", "application/json"
var fileInfo: string
with fileInfo:
add "[{"
add("\"name\": \"" & file.name & "\",")
add("\"tags\": \"" & file.tags & "\"")
add "}]"
resp Http200, fileInfo & "\n", "application/json"