This commit is contained in:
seb
2026-07-31 07:40:27 +02:00
parent bbd69e8c7c
commit 39c5820947
4 changed files with 9 additions and 9 deletions

View File

@@ -117,7 +117,7 @@ Backend mapping:
| --- | --- | --- |
| `create` | `({ parentId, sort })` | `id` |
| `updateParentId` | `(id, parentId)` | `void` |
| `delete` | `(id)` | `void` |
| `delete` | `(id)` | `void` — blocked by FK if `categoryarticle` (or child categories) still reference it |
| `getTree` | `(rootId)` | `{ id, parentId, sort }[]` |
---

View File

@@ -332,7 +332,7 @@ BEGIN
id INT IDENTITY(1,1) PRIMARY KEY,
category_id INT NOT NULL,
article_id INT NOT NULL,
CONSTRAINT FK_categoryarticle_category FOREIGN KEY (category_id) REFERENCES category(id) ON DELETE CASCADE,
CONSTRAINT FK_categoryarticle_category FOREIGN KEY (category_id) REFERENCES category(id) ON DELETE NO ACTION,
CONSTRAINT FK_categoryarticle_article FOREIGN KEY (article_id) REFERENCES article(id) ON DELETE CASCADE,
CONSTRAINT UQ_categoryarticle_category_article UNIQUE (category_id, article_id)
);

View File

@@ -46,11 +46,14 @@ SELECT
c.name,
c.root_category_id AS rootCategoryId,
c.default_language_id AS languageId,
c.taxrate,
c.reducedtaxrate,
c.taxfreerate
tr.rate AS taxrate,
rtr.rate AS reducedtaxrate,
tfr.rate AS taxfreerate
FROM company c
INNER JOIN companyuser cu ON cu.company_id = c.id
LEFT JOIN tax tr ON tr.id = c.taxrate
LEFT JOIN tax rtr ON rtr.id = c.reducedtaxrate
LEFT JOIN tax tfr ON tfr.id = c.taxfreerate
WHERE cu.google_auth_id = @authId
`;

View File

@@ -2,9 +2,6 @@ import { DELETE } from '../../sql/category.js';
export default function del(pool) {
return async (id) => {
await pool
.request()
.input('id', id)
.query(DELETE);
await pool.request().input('id', id).query(DELETE);
};
}