L
Size: a a a
L
L
M
В
В
N
L
const flowRight = (val, fns) => fns.reduceRight((s, f) => f(s), val)
p
p
p
L
const flowRight = (val, [...fns], fn = fns.pop()) => fn ? flow(fn(val), fns) : val
p
const flowRight = (val, [...fns], fn = fns.pop()) => fn ? flow(fn(val), fns) : val
L
const flowRight = (val, [...fns], fn = fns.pop()) => fn ? flowRight(fn(val), fns) : val
p
const flowRight = (val, [...fns], fn = fns.pop()) => fn ? flowRight(fn(val), fns) : val
е
async handleSubmit() {
let formData = {
name: this.state.name,
email: this.state.email,
phone: this.state.number,
position_id: this.state.userPosition.id,
photo: this.state.image
}
let token = this.state.token;
await fetch('https://frontend-test-assignment-api.abz.agency/api/v1/users', {
method: 'POST',
body: formData,
headers: {
'Token': token, // get token with GET api/v1/token method
},
})
.then(function (response) {
return response.json();
})
.then(function (data) {
console.log(data); if (data.success) {
// process success response
} else {
// proccess server errors
}
})
.catch(function (error) {
// proccess network errors
});
}
S
async handleSubmit() {
let formData = {
name: this.state.name,
email: this.state.email,
phone: this.state.number,
position_id: this.state.userPosition.id,
photo: this.state.image
}
let token = this.state.token;
await fetch('https://frontend-test-assignment-api.abz.agency/api/v1/users', {
method: 'POST',
body: formData,
headers: {
'Token': token, // get token with GET api/v1/token method
},
})
.then(function (response) {
return response.json();
})
.then(function (data) {
console.log(data); if (data.success) {
// process success response
} else {
// proccess server errors
}
})
.catch(function (error) {
// proccess network errors
});
}
З🧟
е
З🧟
З🧟