✨ Asynchronous ✨ multiple fields ✨ Sanity UI ✨ Easy! ✨
Show multiple fields in an object field, based on a condition set through the "options" object. Simply return true/false from "condition" function, even asynchronously!
/*-----Scaffolding-----*/ | |
.header { | |
background: #2d2d2d; | |
} | |
.content { | |
background: #2d2d2d; | |
} |
app.get('/check-coupon', function(req, res, next) { | |
stripe.coupons.retrieve(req.body.coupon, function(err, coupon) { | |
if (err) return res.json({ valid: false }); | |
res.json({ valid: true }); | |
}) | |
}) |
$('.add-coupon').each(function() { | |
$(this).click(function() { | |
var couponVal = $('.coupon', this).val(); | |
$('span', this).text('Applying'); | |
$.getJSON('/check-coupon', { | |
coupon: couponVal | |
}, function(data) { | |
// Invalid | |
if (!data.valid) { |
remote: npm ERR! install Couldn't read dependencies | |
remote: npm ERR! Error: ENOENT, open '/var/sites/twentyoverten.com/templates/t1/package.json' | |
remote: npm ERR! If you need help, you may report this log at: | |
remote: npm ERR! <http://github.com/isaacs/npm/issues> | |
remote: npm ERR! or email it to: | |
remote: npm ERR! <[email protected]> | |
remote: | |
remote: npm ERR! System Linux 3.2.0-23-virtual | |
remote: npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" | |
remote: npm ERR! cwd /var/sites/twentyoverten.com/templates/t1 |
Creating a reliable link component for any type of url
Creating more than one color scheme with Tailwind and Next.js