fix: P0/P1 fixes (auth+limit+schema) + project audit docs

This commit is contained in:
2026-05-31 09:42:46 +03:00
parent d81430dc9a
commit 0413b44051
9 changed files with 385 additions and 10 deletions
+6 -1
View File
@@ -187,10 +187,15 @@ async function getAllCompanies() {
* @param {number|null} newLimit — новый лимит или null для сброса
*/
async function setLimit(companyId, newLimit) {
await pool.query(
const result = await pool.query(
'UPDATE companies SET custom_limit = $1, updated_at = NOW() WHERE id = $2',
[newLimit, companyId]
);
if (result.rowCount === 0) {
const err = new Error('Company not found: ' + companyId);
err.status = 404;
throw err;
}
}
// ── Export ──