u
This commit is contained in:
16
src/db/category.js
Normal file
16
src/db/category.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import { getStore } from './store.js';
|
||||
|
||||
export async function getTreeForCompany(googleAuthId, companyId) {
|
||||
const store = await getStore();
|
||||
return store.category.getTreeForCompany(googleAuthId, companyId);
|
||||
}
|
||||
|
||||
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 });
|
||||
}
|
||||
@@ -5,9 +5,9 @@ export async function listCompanies(authId) {
|
||||
return store.company.list(authId);
|
||||
}
|
||||
|
||||
export async function createCompany(authId, data) {
|
||||
export async function createCompany(googleAuthId, data) {
|
||||
const store = await getStore();
|
||||
return store.company.create({ ...data, authId });
|
||||
return store.company.create({ ...data, googleAuthId });
|
||||
}
|
||||
|
||||
export async function updateCompany(id, data) {
|
||||
|
||||
Reference in New Issue
Block a user