Test can now register a user and log in.
This commit is contained in:
parent
a22682878c
commit
35d1b06a79
2 changed files with 54 additions and 32 deletions
|
@ -60,7 +60,7 @@ func PostApiRegister(c *fiber.Ctx) error {
|
|||
Columns("username", "email", "password").
|
||||
Values(user.Username, user.Email, user.Password).ToSql()
|
||||
|
||||
err = data.Insert(err, sql, args...)
|
||||
err = data.Exec(err, sql, args...)
|
||||
if err != nil { return IfErrNil(err, c) }
|
||||
|
||||
return c.Redirect("/login/")
|
||||
|
@ -100,7 +100,7 @@ func PostApiLink(c *fiber.Ctx) error {
|
|||
Columns("stream_id", "url", "description").
|
||||
Values(link.StreamId, link.Url, link.Description).ToSql()
|
||||
|
||||
err = data.Insert(err, sql, args...)
|
||||
err = data.Exec(err, sql, args...)
|
||||
if(err != nil) { goto fail }
|
||||
|
||||
return c.Redirect("/live/")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue