u
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import * as db from '../../../db/googleAuth.js';
|
||||
import { clearCachedUser } from '../../middleware/auth.js';
|
||||
import { setUserCompany } from '../../sse.js';
|
||||
|
||||
/**
|
||||
* Registers the selected-company route (requires auth middleware).
|
||||
@@ -17,6 +18,7 @@ export function register(app, basePath = '') {
|
||||
* security:
|
||||
* - cookieAuth: []
|
||||
* x-markdown: auth/selected-company.md
|
||||
* x-signals: [company]
|
||||
* requestBody:
|
||||
* required: true
|
||||
* content:
|
||||
@@ -76,6 +78,7 @@ export function register(app, basePath = '') {
|
||||
selectedCompanyId: updated.selectedCompanyId,
|
||||
};
|
||||
|
||||
setUserCompany(req.user.id, updated.selectedCompanyId);
|
||||
res.status(200).json({ user });
|
||||
} catch (error) {
|
||||
console.error('Set selected company failed:', error);
|
||||
|
||||
Reference in New Issue
Block a user