MCPcopy Index your code
hub / github.com/writefreely/writefreely / IsUsersInvite

Method IsUsersInvite

database.go:2766–2774  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

2764// and an error other than sql no rows, if any. Will return false in the event
2765// of an error.
2766func (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
2776func (db *datastore) GetUsersInvitedCount(id string) int64 {
2777 var count int64

Callers 1

handleViewInviteFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected