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
const User = use('App/Models/user') | |
const Article = use('App/Models/Article') | |
const Database = use('Database') | |
async createArticleWithUser({ request, response, session }) { | |
const trx = await Database.beginTransaction() | |
try{ | |
const { topic } = request.post() | |
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
if (CustomerFundsDeducted()) { | |
PostFundsToStore() | |
} else { | |
// throw an error | |
} |
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
"use strict"; | |
const jwt = require("jsonwebtoken"); | |
const bcrypt = require("bcrypt"); | |
const randomstring = require("randomstring"); | |
const nodemailer = require("nodemailer"); | |
const env = require("dotenv").config(); | |
const mailgun = require("mailgun-js"); | |
const credentials = { | |
apiKey: process.env.AFRICASTALKING_API_KEY, // use your sandbox app API key for development in the test environment |