Update dependencies

This commit is contained in:
Jonathan Cremin 2019-06-08 07:52:57 -07:00
parent 1158db6d7e
commit 5a7e695e53
10 changed files with 864 additions and 870 deletions

View file

@ -20,7 +20,7 @@ export default async (ctx, next) => {
const userToken = await ctx.redis.get(ctx.req.headers.authorization.substr(1));
ctx.assert(userToken, 401, '{"error": {"message": "Invalid token.", "code": 606}}');
debug('Token found');
user = await models.user.findById(userToken);
user = await models.user.findByPk(userToken);
if (!user) {
login.save();
return;

View file

@ -29,7 +29,7 @@ export async function create(ctx) {
delete customer.subscriptions;
const user = await models.user.findById(ctx.user.id);
const user = await models.user.findByPk(ctx.user.id);
user.plan = 'Pro';
await user.save();
@ -69,7 +69,7 @@ export async function create(ctx) {
}
export async function cancel(ctx) {
const user = await models.user.findById(ctx.user.id);
const user = await models.user.findByPk(ctx.user.id);
const transactions = await user.getTransactions();
const transaction = transactions[0];

View file

@ -45,7 +45,7 @@ export async function settings(ctx) {
ctx.request.body.current_password, 400,
'{"error": {"message": "Current Password required to update account.", "code": 612}}',
);
const user = await models.user.findById(ctx.user.id);
const user = await models.user.findByPk(ctx.user.id);
ctx.assert(
await passwords.match(ctx.request.body.current_password, user.password), 400,
'{"error": {"message": "Incorrect password", "code": 606}}',