IsUsersInvite returns true if the user with ID created the invite with code and an error other than sql no rows, if any. Will return false in the event of an error.
(code string, userID int64)
| 2764 | // and an error other than sql no rows, if any. Will return false in the event |
| 2765 | // of an error. |
| 2766 | func (db *datastore) IsUsersInvite(code string, userID int64) (bool, error) { |
| 2767 | var id string |
| 2768 | err := db.QueryRow("SELECT id FROM userinvites WHERE id = ? AND owner_id = ?", code, userID).Scan(&id) |
| 2769 | if err != nil && err != sql.ErrNoRows { |
| 2770 | log.Error("Failed selecting invite: %v", err) |
| 2771 | return false, err |
| 2772 | } |
| 2773 | return id != "", nil |
| 2774 | } |
| 2775 | |
| 2776 | func (db *datastore) GetUsersInvitedCount(id string) int64 { |
| 2777 | var count int64 |