So many things

This commit is contained in:
2026-02-17 21:52:59 -06:00
parent 8e225aa254
commit a99c9f5102
27 changed files with 5398 additions and 123 deletions
+17 -1
View File
@@ -1,8 +1,16 @@
import api from "../axios";
export const company = {
async fetch(accessToken: string, id: string) {
async fetch(
accessToken: string,
id: string,
options?: { includeAddress?: boolean },
) {
const params: Record<string, string> = {};
if (options?.includeAddress) params.includeAddress = "true";
const company = await api.get(`/v1/company/companies/${id}`, {
params,
headers: {
Authorization: `Bearer ${accessToken}`,
},
@@ -27,6 +35,14 @@ export const company = {
return companies.data;
},
async count(accessToken: string) {
const response = await api.get("/v1/company/count", {
headers: {
Authorization: `Bearer ${accessToken}`,
},
});
return response.data.data.count;
},
async fetchConfigurations(accessToken: string, id: string) {
const configurations = await api.get(
`/v1/company/companies/${id}/configurations`,