22 lines
581 B
JavaScript
22 lines
581 B
JavaScript
import { getStore } from './store.js';
|
|
|
|
export async function listCompanies(authId) {
|
|
const store = await getStore();
|
|
return store.company.list(authId);
|
|
}
|
|
|
|
export async function createCompany(googleAuthId, data) {
|
|
const store = await getStore();
|
|
return store.company.create({ ...data, googleAuthId });
|
|
}
|
|
|
|
export async function updateCompany(id, data) {
|
|
const store = await getStore();
|
|
return store.company.update(id, data);
|
|
}
|
|
|
|
export async function deleteCompany(companyId) {
|
|
const store = await getStore();
|
|
await store.company.delete(companyId);
|
|
}
|