mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 12:50:38 +00:00
fix: should retrieve user inactive error in login response API.
fix: prevent from delete or inactivate the current authorized user.
This commit is contained in:
@@ -8,9 +8,8 @@ exports.up = function (knex) {
|
||||
table.string('phone_number').unique();
|
||||
table.string('password');
|
||||
table.boolean('active');
|
||||
table.integer('role_id').unique();
|
||||
table.string('language');
|
||||
|
||||
|
||||
table.integer('tenant_id').unsigned();
|
||||
|
||||
table.date('invite_accepted_at');
|
||||
@@ -18,10 +17,6 @@ exports.up = function (knex) {
|
||||
|
||||
table.dateTime('deleted_at');
|
||||
table.timestamps();
|
||||
}).then(() => {
|
||||
// knex.seed.run({
|
||||
// specific: 'seed_users.js',
|
||||
// })
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ export default class SystemUserRepository extends SystemRepository {
|
||||
* @param {number} userId
|
||||
*/
|
||||
async deleteById(userId: number) {
|
||||
const user = this.getById(userId);
|
||||
const user = await this.getById(userId);
|
||||
await SystemUser.query().where('id', userId).delete();
|
||||
this.flushUserCache(user);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user