add: company info & edit company view

This commit is contained in:
Alexandro Uc Santos
2023-11-29 21:07:46 -06:00
parent dd674b053b
commit df8aff2745
18 changed files with 548 additions and 48 deletions

View File

@@ -2,7 +2,7 @@ import api from "../lib/axios";
export const getLoadDirectories = async(filterStr) => {
try {
const endpoint = `/public-loads${filterStr}`;
const endpoint = `/v1/public-loads${filterStr}`;
const {data} = await api.get(endpoint);
return data.data;
} catch (error) {
@@ -13,7 +13,7 @@ export const getLoadDirectories = async(filterStr) => {
export const getVehicleDirectories = async(filter) => {
try {
const endpoint = `/public-vehicles/published${filter}`;
const endpoint = `/v1/public-vehicles/published${filter}`;
const {data} = await api.get(endpoint);
return data.data;
} catch (error) {
@@ -25,7 +25,7 @@ export const getVehicleDirectories = async(filter) => {
export const getFreeVehicles = async() => {
try {
// console.log(process.env.API_URL + "/vehicles/?status=Free&updatedAt[$gt]=" + moment.utc(lasthour).valueOf());
const endpoint = `/public-vehicles/location`;
const endpoint = `/v1/public-vehicles/location`;
console.log({endpoint});
const {data} = await api.get(endpoint);
return data.data;
@@ -50,7 +50,7 @@ export const getNews = async() => {
export const getCompanies = async(filter) => {
try {
const endpoint = `/public-companies/${filter}`;
const endpoint = `/v1/public-companies/${filter}`;
console.log(endpoint);
const {data} = await api.get(endpoint);
return data.data;
@@ -62,7 +62,7 @@ export const getCompanies = async(filter) => {
export const getUsersCompany = async(filter) => {
try {
const endpoint = `/users?${filter}`;
const endpoint = `/v1/users?${filter}`;
// console.log({endpoint});
const {data} = await api.get(endpoint);
// console.log(data);
@@ -86,7 +86,7 @@ export const getSettingsQuery = async(filter) => {
export const searchcategories = async(query) => {
try {
const endpoint = "/product-categories/find?regex=" + query;
const endpoint = "/v1/product-categories/find?regex=" + query;
const {data} = await api.get(endpoint);
return data.data;
} catch (error) {
@@ -97,7 +97,7 @@ export const searchcategories = async(query) => {
export const searchstates = async(query) => {
try {
const endpoint = "/states/find?regex=" + query;
const endpoint = "/v1/states/find?regex=" + query;
const {data} = await api.get(endpoint);
return data.data;
} catch (error) {