EN-94: fix: Migrate to api v1
This commit is contained in:
@@ -11,6 +11,8 @@
|
||||
import { useRouter } from 'vue-router';
|
||||
import { useNotificationsStore } from '../stores/notifications';
|
||||
import { useAuthStore } from '../stores/auth';
|
||||
import { complete_registry } from "../services/auth";
|
||||
import { updateMyUserProfile } from "../services/company"
|
||||
|
||||
const notifications = useNotificationsStore();
|
||||
const auth = useAuthStore();
|
||||
@@ -63,14 +65,36 @@
|
||||
console.log(company);
|
||||
}
|
||||
|
||||
const handleSendRegister = () => {
|
||||
const handleSendRegister = async () => {
|
||||
const error = validatiosUser();
|
||||
if(error != '') {
|
||||
msgError.value = error;
|
||||
clearMessages();
|
||||
return;
|
||||
}
|
||||
console.log(user);
|
||||
const companyData = {
|
||||
company_name : company.name,
|
||||
rfc : company.rfc,
|
||||
categories: company.segments.map((e) => e._id ),
|
||||
company_city: company.cities.map((e) => e.city_name),
|
||||
company_state: company.states.map((e) => e.state_name),
|
||||
truck_type: company.truckTypes.map((e) => e.meta_value),
|
||||
company_description : company.description,
|
||||
company_type : typeCompany.typeCompany,
|
||||
};
|
||||
const result = await complete_registry( companyData );
|
||||
console.log(result);
|
||||
if(result.msg === 'success' && result.data !== null){
|
||||
localStorage.setItem('id', result.data._id);
|
||||
}
|
||||
|
||||
const userData = {
|
||||
"first_name" : user.name,
|
||||
"last_name" : user.lastName,
|
||||
"phone" : user.phone1,
|
||||
"phone2" : user.phone2,
|
||||
};
|
||||
await updateMyUserProfile( userData );
|
||||
/////// Datos debug ///////
|
||||
notifications.show = true;
|
||||
notifications.text = 'Los datos se llenaron correctamente';
|
||||
|
||||
Reference in New Issue
Block a user