nimpretty

This commit is contained in:
array-in-a-matrix 2024-07-11 19:41:15 -04:00
parent 58596be4ac
commit 759bb75328
2 changed files with 3 additions and 2 deletions

View file

@ -17,7 +17,8 @@ proc createAuthenticationRoutes*() =
]#
post "/api/v1/newUser":
# TODO: sanitization + check if username and email are unique
if @"username".isEmptyOrWhitespace() or @"email".isEmptyOrWhitespace() or @"password".isEmptyOrWhitespace():
if @"username".isEmptyOrWhitespace() or @"email".isEmptyOrWhitespace() or
@"password".isEmptyOrWhitespace():
resp Http403, "Not all required parameters are provided.\n"
var user = newUser(@"username", @"email", @"password")

View file

@ -8,7 +8,7 @@ type File* = ref object of Model
name*: string
tags*: string #? This is a temporary hack should be `seq[string]` or `JsonNode` instead
# creates a new file object and sets default values, recommended by the norm documentation
# creates a new file object and sets default values, recommended by the norm documentation
func newFile*(user: User = newUser(), path: string = "", name: string = "",
tags: string = ""): File =
File(owner: user, path: path, name: name, tags: tags)