fix: P0/P1 fixes (auth+limit+schema) + project audit docs
This commit is contained in:
+6
-1
@@ -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 ──
|
||||
|
||||
Reference in New Issue
Block a user