(client: Client)
| 108 | |
| 109 | // Newest first; the admin page renders pending + used together. |
| 110 | export const listInviteCodes = async (client: Client): Promise<readonly InviteCodeRow[]> => { |
| 111 | const result = await client.execute("SELECT * FROM invite_code ORDER BY created_at DESC"); |
| 112 | return result.rows.map(toRow); |
| 113 | }; |
| 114 | |
| 115 | // Revoke = delete a pending (unused) code. Used codes are kept as an audit row |
| 116 | // (their membership already exists); deleting one would not remove the member. |