3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-18 07:35:02 +00:00

Dashboard work and related

This commit is contained in:
Dragory 2019-06-23 19:18:41 +03:00
parent 5279ab06fa
commit 1ecce52973
44 changed files with 637 additions and 272 deletions

View file

@ -32,6 +32,18 @@ export class Configs extends BaseRepository {
return (await this.getActiveByKey(key)) != null;
}
getRevisions(key, num = 10) {
return this.configs.find({
relations: this.getRelations(),
where: { key },
select: ["id", "key", "is_active", "edited_by", "edited_at"],
order: {
edited_at: "DESC",
},
take: num,
});
}
async saveNewRevision(key, config, editedBy) {
return connection.transaction(async entityManager => {
const repo = entityManager.getRepository(Config);