mirror of
https://github.com/koodiklinikka/koodiklinikka.fi-api.git
synced 2026-02-07 08:49:53 +00:00
Membership registration & payment API (#4)
* remove newrelic from use in devenv * add endpoint for membership payments * fix some wierd spaces * minor code styling and logging stuff * replace non-breaking spaces with normal ones * remove duplicate function * minor code styling * add functionality for writing new member to google sheets * add config example * update example config, start using config in google credentials * remove var creds from google sheets auth * rename config.example to config.template and fix readme * add async and google-spreadsheet packages * rename workingWithRows to addRow * return missing header from readme * minor code styling * flatten google config structure, add address fields * add request validation to membership endpoint * fix config field names * more error handling, fix indentation
This commit is contained in:
committed by
Riku Rouvila
parent
181a48c0f6
commit
f783a27045
12
utils/validateRequest.js
Normal file
12
utils/validateRequest.js
Normal file
@@ -0,0 +1,12 @@
|
||||
var Joi = require('joi');
|
||||
|
||||
module.exports = function validateRequest(schema) {
|
||||
return function handler(req, res, next) {
|
||||
Joi.validate(req.body, schema, function (err, value) {
|
||||
if(err) {
|
||||
return res.status(400).send(err.details)
|
||||
}
|
||||
next();
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user