ensure that user and auth.email are transmitted
This commit is contained in:
parent
8481740ea5
commit
068c1e9f63
|
|
@ -2,6 +2,7 @@ const db = require("../models/index");
|
||||||
const {registerUser} = require("../helper/user.helper");
|
const {registerUser} = require("../helper/user.helper");
|
||||||
const Player = db.Player;
|
const Player = db.Player;
|
||||||
const User = db.User;
|
const User = db.User;
|
||||||
|
const Auth = db.Auth;
|
||||||
const Op = db.Sequelize.Op;
|
const Op = db.Sequelize.Op;
|
||||||
|
|
||||||
exports.insert = (req, res) => {
|
exports.insert = (req, res) => {
|
||||||
|
|
@ -63,7 +64,15 @@ exports.findOneByUserId = (req, res) => {
|
||||||
|
|
||||||
Player.findOne({
|
Player.findOne({
|
||||||
where: { userId: userId },
|
where: { userId: userId },
|
||||||
include: { model: User }
|
include: {
|
||||||
|
model: User,
|
||||||
|
as: 'user',
|
||||||
|
include: {
|
||||||
|
model: Auth,
|
||||||
|
as: 'auth',
|
||||||
|
attributes: ['email']
|
||||||
|
}
|
||||||
|
}
|
||||||
}).then(data => {
|
}).then(data => {
|
||||||
if (data) {
|
if (data) {
|
||||||
res.send(data);
|
res.send(data);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue