0
Good night
I have a function that registers a request in firebase:
async function handleSubmit(){
let endereco = `${route.params?.local.local[0]} ${route.params?.local.local[1]}, ${route.params?.local.local[2]} - ${route.params?.local.local[3]}.`
console.log(endereco)
let nome = user.nome;
let key = await firebase.database().ref('solicitacoes').push().key;
await firebase.database().ref('solicitacoes').child(key).set({
uriImg: uriImg.uri,
local: endereco,
servico: servico,
descricao: descricao,
date: format(new Date(), 'dd/MM/yyyy'),
situacao: 'Aberto',
solicitante: nome
});
setUriImg({});
setServico('');
setDescricao('');
navigation.navigate('home');
}
I need to do a function that changes only the situation from "Open" to "Closed". Remembering that I want to do this only for one item, not for all requests already registered.