[server][cast] Fix err handling
This commit is contained in:
parent
627eab472c
commit
a62edad446
1 changed files with 3 additions and 0 deletions
|
@ -16,6 +16,9 @@ type Repository struct {
|
|||
|
||||
func (r *Repository) AddCode(ctx context.Context, pubKey string, ip string) (string, error) {
|
||||
codeValue, err := random.GenerateAlphaNumString(6)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
_, err = r.DB.ExecContext(ctx, "INSERT INTO casting (code, public_key, id, ip) VALUES ($1, $2, $3, $4)", codeValue, pubKey, uuid.New(), ip)
|
||||
if err != nil {
|
||||
return "", err
|
||||
|
|
Loading…
Reference in a new issue