This commit is contained in:
seb
2026-10-28 19:31:41 +01:00
parent 01d6aa0e3f
commit 1881830b0a
13 changed files with 81 additions and 27 deletions

View File

@@ -1,6 +1,5 @@
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).
@@ -18,7 +17,7 @@ export function register(app, basePath = '') {
* security:
* - cookieAuth: []
* x-markdown: auth/selected-company.md
* x-signals: [company]
* x-signals: [user, company]
* requestBody:
* required: true
* content:
@@ -78,7 +77,6 @@ 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);