Files
dashback/src/db/category.js
seb e6c24654dd Align store calls with selected-company scoping and add entity numbers.
Drop companyId from company-scoped store wrappers and routes, add GET /entity/next-number plus optional number on entity create/update, and document dashdbschema API.md lookup in sibling-repos.
2026-08-07 06:22:13 +02:00

47 lines
1.5 KiB
JavaScript

import { getStore } from './store.js';
export async function getTreeForCompany(googleAuthId) {
const store = await getStore();
return store.category.getTreeForCompany(googleAuthId);
}
export async function createUnderParent({ googleAuthId, parentId, name }) {
const store = await getStore();
return store.category.createUnderParent({ googleAuthId, parentId, name });
}
export async function deleteCategory({ googleAuthId, id }) {
const store = await getStore();
await store.category.delete({ googleAuthId, id });
}
export async function getCategoryArticles(googleAuthId, categoryId) {
const store = await getStore();
return store.category.getCategoryArticles(googleAuthId, categoryId);
}
export async function rename({ googleAuthId, id, name }) {
const store = await getStore();
return store.category.rename({ googleAuthId, id, name });
}
export async function order({ googleAuthId, parentId, categoryIds }) {
const store = await getStore();
return store.category.order({ googleAuthId, parentId, categoryIds });
}
export async function move({ googleAuthId, id, parentId }) {
const store = await getStore();
return store.category.move({ googleAuthId, id, parentId });
}
export async function addImage(googleAuthId, categoryId, imageBuffer) {
const store = await getStore();
return store.category.addImage(googleAuthId, categoryId, imageBuffer);
}
export async function deleteImage(googleAuthId, categoryId) {
const store = await getStore();
return store.category.deleteImage(googleAuthId, categoryId);
}