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.
 

21 lines
487 B

// _core : social/userPessoa
const message = _req.getString("message")
const communityUid = _req.getString("community_uid")
const dbComunidade = _db.get('comunidade', communityUid)
const data = _val.map()
.set("pessoa_id", userPessoa().getInt("id"))
.set("mensagem", message)
.set("momento", _db.timestamp())
if (dbComunidade) {
data.set("comunidade_id", dbComunidade.getInt("id"))
}
_db.insert(
"publicacao",
data
)
_out.json(_val.map().set("result", true))