u
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { getStore } from './store.js';
|
||||
import { requireSelectedCompanyAdmin } from './companyuser.js';
|
||||
|
||||
export async function list(googleAuthId) {
|
||||
const store = await getStore();
|
||||
@@ -11,21 +12,25 @@ export async function getById(googleAuthId, id) {
|
||||
}
|
||||
|
||||
export async function create(googleAuthId, data) {
|
||||
await requireSelectedCompanyAdmin(googleAuthId);
|
||||
const store = await getStore();
|
||||
return store.warehouse.create(googleAuthId, data);
|
||||
}
|
||||
|
||||
export async function update(googleAuthId, id, data) {
|
||||
await requireSelectedCompanyAdmin(googleAuthId);
|
||||
const store = await getStore();
|
||||
return store.warehouse.update(googleAuthId, id, data);
|
||||
}
|
||||
|
||||
export async function order(googleAuthId, data) {
|
||||
await requireSelectedCompanyAdmin(googleAuthId);
|
||||
const store = await getStore();
|
||||
return store.warehouse.order(googleAuthId, data);
|
||||
}
|
||||
|
||||
export async function remove(googleAuthId, id) {
|
||||
await requireSelectedCompanyAdmin(googleAuthId);
|
||||
const store = await getStore();
|
||||
return store.warehouse.delete(googleAuthId, id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user