You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

42 lines
1.2 KiB

// // _core : social/userPessoa
// const dbComunidade = _db.queryFirst(`
// SELECT
// uid,
// nome,
// descricao,
// imagem,
// (
// SELECT count(id)
// FROM pessoa_comunidade
// WHERE pessoa_id = ?
// AND comunidade_id = comunidade.id
// ) seguindo,
// (
// SELECT count(id)
// FROM pessoa_comunidade
// WHERE comunidade_id = comunidade.id
// ) pessoas,
// (
// SELECT count(id)
// FROM publicacao
// WHERE comunidade_id = comunidade.id
// ) publicacoes
// FROM comunidade
// WHERE active = true
// AND uid = ?::uuid
// ORDER BY nome
// `, userPessoa().getInt("id"), _req.getString("uid"))
// const data = _val.map()
// if (dbComunidade != null) {
// data.set("uid", dbComunidade.getString("uid"))
// .set("name", dbComunidade.getString("nome"))
// .set("description", dbComunidade.getString("descricao"))
// .set("following", dbComunidade.getInt("seguindo") > 0)
// .set("people", dbComunidade.getInt("pessoas"))
// .set("publications", dbComunidade.getInt("publicacoes"))
// }
// _out.json(data)