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

@@ -5,7 +5,7 @@ import JSZip from 'jszip';
import * as db from '../../db/company.js';
import * as googleAuth from '../../db/googleAuth.js';
import { clearCachedUser } from '../middleware/auth.js';
import { clearDeletedCompany, emit, setUserCompany } from '../sse.js';
import { emit } from '../sse.js';
import { initCompanyVfs } from '../../tools/vfs.js';
import { executeCompanyImport } from '../../services/companyImport.js';
import { executeCompanyExport } from '../../services/companyExport.js';
@@ -138,7 +138,7 @@ export function register(app, basePath = '') {
* security:
* - cookieAuth: []
* x-markdown: company/create.md
* x-signals: [company]
* x-signals: [user, company]
* requestBody:
* required: true
* content:
@@ -217,7 +217,6 @@ export function register(app, basePath = '') {
console.error('Failed to initialize company VFS:', vfsErr);
}
const authRow = await googleAuth.getAllowedEmail(req.user.email);
setUserCompany(req.user.id, authRow.selectedCompanyId);
res.status(201).json({ company, user: userPayload(authRow) });
} catch (error) {
const status = companyErrorStatus(error);
@@ -895,7 +894,7 @@ export function register(app, basePath = '') {
* security:
* - cookieAuth: []
* x-markdown: company/delete.md
* x-signals: [company]
* x-signals: [user, company]
* parameters:
* - in: path
* name: id
@@ -960,7 +959,6 @@ export function register(app, basePath = '') {
try {
await db.deleteCompany(parsedId.companyId);
clearDeletedCompany(parsedId.companyId);
res.sendStatus(204);
} catch (error) {
console.error('Delete company failed:', error);