mirror of
https://github.com/glimpse-app/server.git
synced 2025-04-02 10:52:45 -04:00
return JSON with updated file info
This commit is contained in:
parent
e366c3b6e6
commit
6c10a78dfe
1 changed files with 11 additions and 2 deletions
|
@ -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"
|
||||
|
|
Loading…
Add table
Reference in a new issue