mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-15 20:30:33 +00:00
feat: users api without organization id.
This commit is contained in:
@@ -5,9 +5,12 @@ import {
|
||||
query,
|
||||
param,
|
||||
} from 'express-validator';
|
||||
import JWTAuth from 'api/middleware/jwtAuth';
|
||||
import asyncMiddleware from 'api/middleware/asyncMiddleware';
|
||||
import BaseController from 'api/controllers/BaseController';
|
||||
import UsersService from 'services/Users/UsersService';
|
||||
import TenancyMiddleware from 'api/middleware/TenancyMiddleware';
|
||||
import AttachCurrentTenantUser from 'api/middleware/AttachCurrentTenantUser';
|
||||
import { ServiceError, ServiceErrors } from 'exceptions';
|
||||
import { ISystemUserDTO } from 'interfaces';
|
||||
|
||||
@@ -22,6 +25,10 @@ export default class UsersController extends BaseController{
|
||||
router() {
|
||||
const router = Router();
|
||||
|
||||
router.use(JWTAuth);
|
||||
router.use(AttachCurrentTenantUser);
|
||||
router.use(TenancyMiddleware);
|
||||
|
||||
router.put('/:id/inactivate', [
|
||||
...this.specificUserSchema,
|
||||
],
|
||||
|
||||
@@ -60,6 +60,7 @@ export default () => {
|
||||
app.use('/organization', Container.get(Organization).router());
|
||||
app.use('/ping', Container.get(Ping).router());
|
||||
app.use('/jobs', Container.get(Jobs).router());
|
||||
app.use('/users', Container.get(Users).router());
|
||||
|
||||
// - Dashboard routes.
|
||||
// ---------------------------
|
||||
@@ -74,7 +75,6 @@ export default () => {
|
||||
dashboard.use(I18nAuthenticatedMiddlware);
|
||||
dashboard.use(EnsureTenantIsSeeded);
|
||||
|
||||
dashboard.use('/users', Container.get(Users).router());
|
||||
dashboard.use('/invite', Container.get(InviteUsers).authRouter());
|
||||
dashboard.use('/currencies', Container.get(Currencies).router());
|
||||
dashboard.use('/settings', Container.get(Settings).router());
|
||||
|
||||
Reference in New Issue
Block a user