aboutsummaryrefslogtreecommitdiffstats
path: root/routes/send.js
blob: 1bd4910a95f4fd6133a8804db911ce2a904c5576 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import { err } from "$lib/logging";
import sendInternal from "$lib/sendInternal";
import { requirePin } from "$lib/auth";

export default async (req, res, next) => {
  try {
    await requirePin(req);
    let payment = await sendInternal(req.body, req.user);
    res.send(payment);
  } catch (e) {
    console.log(e)
    err("problem sending internal payment", e.message);
    return res.code(500).send(e.message);
  }
};