diff options
author | Grant Shangreaux <grant@unabridgedsoftware.com> | 2024-06-19 12:01:29 -0500 |
---|---|---|
committer | Grant Shangreaux <grant@unabridgedsoftware.com> | 2024-06-19 12:01:29 -0500 |
commit | 5a586d369c823a040989283a3650444a2b0c0913 (patch) | |
tree | a617035409c3c076c10bcd1449cf5ad70ef8127a /site/invites.lisp | |
parent | 132bb57d594894f7c9bdfea23e17971028acaedf (diff) |
[87] Add: invite creation, listing, and deletion when used up
Diffstat (limited to 'site/invites.lisp')
-rw-r--r-- | site/invites.lisp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/site/invites.lisp b/site/invites.lisp new file mode 100644 index 0000000..b463a4d --- /dev/null +++ b/site/invites.lisp @@ -0,0 +1,14 @@ +(in-package #:vampire) + +(wknd:defendpoint invites + :using user-known + :post :to "invites" + :handle + (progn + (db:with-transaction () + (make-instance 'invite :maker user :uses-remaining 1)) + (wknd:endpoint-redirect 'home.html))) + +(defun invite-validp (invite) + (let ((uses (uses-remaining invite))) + (or (< 0 uses) (null uses)))) |