Renaming database primary key
This commit is contained in:
@@ -11,7 +11,7 @@ const { accounts } = require('../database/models');
|
||||
const route = async (req, res) => {
|
||||
const account = await accounts.findOne({
|
||||
where: {
|
||||
id: req.user.id
|
||||
index: req.user.index
|
||||
}
|
||||
});
|
||||
|
||||
@@ -30,7 +30,7 @@ const route = async (req, res) => {
|
||||
},
|
||||
{
|
||||
where: {
|
||||
id: req.user.id
|
||||
index: req.user.index
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ const { accounts } = require('../database/models');
|
||||
const route = async (req, res) => {
|
||||
const account = await accounts.findOne({
|
||||
where: {
|
||||
id: req.user.id
|
||||
index: req.user.index
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ const route = async (req, res) => {
|
||||
hash: hash
|
||||
}, {
|
||||
where: {
|
||||
id: req.user.id
|
||||
index: req.user.index
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ const route = async (req, res) => {
|
||||
//cancel deletion if any
|
||||
await accounts.update({ deletion: null }, {
|
||||
where: {
|
||||
id: account.id
|
||||
index: account.index
|
||||
}
|
||||
});
|
||||
|
||||
@@ -48,7 +48,7 @@ const route = async (req, res) => {
|
||||
}
|
||||
|
||||
//generate the JWT
|
||||
const tokens = generate(account.id, account.username, account.type, account.admin, account.mod);
|
||||
const tokens = generate(account.index, account.username, account.type, account.admin, account.mod);
|
||||
|
||||
//finally
|
||||
res.status(200).json(tokens);
|
||||
|
||||
Reference in New Issue
Block a user