add missing checks and default password
This commit is contained in:
parent
99e9ef98f6
commit
259444b371
|
@ -100,16 +100,18 @@ const Inquilinos = () => {
|
||||||
}))
|
}))
|
||||||
|
|
||||||
const saveTenant = () => {
|
const saveTenant = () => {
|
||||||
if (tenant.email && tenant.number_house) {
|
if (tenant.email && tenant.community_id && tenant.dni
|
||||||
|
&& tenant.name && tenant.last_name && tenant.phone) {
|
||||||
let _tenants = [...tenants]
|
let _tenants = [...tenants]
|
||||||
let _tenant = { ...tenant }
|
let _tenant = { ...tenant }
|
||||||
_tenant.community_id = communityId
|
_tenant.community_id = communityId;
|
||||||
|
_tenant.password = _tenant.email;
|
||||||
console.log(_tenant)
|
console.log(_tenant)
|
||||||
|
|
||||||
fetch(`http://localhost:4000/user/createUser`, {
|
fetch(`http://localhost:4000/user/createUser`, {
|
||||||
cache: 'no-cache',
|
cache: 'no-cache',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: JSON.stringify(tenant),
|
body: JSON.stringify(_tenant),
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue