Improve apps (#12714)

* Allow apps to create direct messages

* Implement getMembers;

* Adds ability to search direct rooms by usernames

* Allow apps to update persistence by association (#12681)
pull/12706/head^2
Marcelo Schmidt 7 years ago committed by Rodrigo Nascimento
parent 607badd28a
commit 3e33c5c638
  1. 15
      packages/rocketchat-apps/server/bridges/persistence.js

@ -92,4 +92,19 @@ export class AppPersistenceBridge {
throw new Error('Not implemented.');
}
async updateByAssociation(association, data, upsert, appId) {
console.log(`The App ${ appId } is updating the record with association to data as follows:`, association, data);
if (typeof data !== 'object') {
throw new Error('Attempted to store an invalid data type, it must be an object.');
}
const query = {
appId,
associations: association,
};
return this.orch.getPersistenceModel().upsert(query, { $set: { data } }, { upsert });
}
}

Loading…
Cancel
Save