-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add actions for waitlist feature
- Loading branch information
1 parent
0b02dd7
commit 2629e22
Showing
2 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
templates/ascent-react/api/controllers/waitlist/join-waitlist.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
module.exports = { | ||
friendlyName: 'Join waitlist', | ||
|
||
description: '', | ||
|
||
inputs: { | ||
email: { | ||
type: 'string', | ||
required: true, | ||
isEmail: true, | ||
maxLength: 200 | ||
} | ||
}, | ||
|
||
exits: { | ||
success: { | ||
responseType: 'redirect', | ||
description: 'Successfully joined waitlist' | ||
}, | ||
badRequest: { | ||
description: 'The provided email address is invalid.', | ||
responseType: 'badRequest' | ||
} | ||
}, | ||
|
||
fn: async function ({ email }) { | ||
await Waitlist.create({ email }).intercept('E_UNIQUE', 'badRequest') | ||
return '/' | ||
} | ||
} |
File renamed without changes.