I created an API where i want to get the return of some fields all together, I tried to concatenate them but it isn't giving me the result in a string.
export async function getByContaBancariaEmpresarialDescricao() {
const resource = await Resource.query()
.select('descricao', 'agencia', 'digito_agencia', 'conta',
'digito_conta', 'ibi.codigo as bancoCodigo', 'ibi.numero as
bancoNumero', 'ibi.banco as bancoNome', 'ibi.IMAGEM_LOGO as
bancoICONE',
('descricao as ContaBancariaEmpresarialDescricao'),
(`descricao`, '+', `conta`, '+', `ibi.numero`)
)
.joinRelation('banco', { alias: 'ibi' });
return resource;
}
And it's returning this:
{
"descricao": "BANCO TRIBANCO",
"agencia": "1111",
"digitoAgencia": "1",
"conta": "1111",
"digitoConta": "1",
"bancoCodigo": 11,
"bancoNumero": "111",
"bancoNome": "BANCO TRIANGULO S/A",
"bancoICONE": null,
"ContaBancariaEmpresarialDescricao": "BANCO TRIBANCO",
"numero": "111"
},
Is there a way to get a return of 'descricao + conta + bancoNumero' all together in a single string?