forked from tangled.org/core
Monorepo for Tangled

appview/models: move db.Signup into models

Signed-off-by: oppiliappan <me@oppi.li>

oppi.li ac76ac2b 9c5547d8

verified
Changed files
+15 -10
appview
db
models
signup
+4 -9
appview/db/signup.go
··· 1 1 package db 2 2 3 - import "time" 3 + import ( 4 + "tangled.org/core/appview/models" 5 + ) 4 6 5 - type InflightSignup struct { 6 - Id int64 7 - Email string 8 - InviteCode string 9 - Created time.Time 10 - } 11 - 12 - func AddInflightSignup(e Execer, signup InflightSignup) error { 7 + func AddInflightSignup(e Execer, signup models.InflightSignup) error { 13 8 query := `insert into signups_inflight (email, invite_code) values (?, ?)` 14 9 _, err := e.Exec(query, signup.Email, signup.InviteCode) 15 10 return err
+10
appview/models/signup.go
··· 1 + package models 2 + 3 + import "time" 4 + 5 + type InflightSignup struct { 6 + Id int64 7 + Email string 8 + InviteCode string 9 + Created time.Time 10 + }
+1 -1
appview/signup/signup.go
··· 164 164 s.pages.Notice(w, noticeId, "Failed to send email.") 165 165 return 166 166 } 167 - err = db.AddInflightSignup(s.db, db.InflightSignup{ 167 + err = db.AddInflightSignup(s.db, models.InflightSignup{ 168 168 Email: emailId, 169 169 InviteCode: code, 170 170 })