So many things
This commit is contained in:
@@ -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`,
|
||||
|
||||
Reference in New Issue
Block a user