add post log api

This commit is contained in:
2020-08-19 12:43:22 +02:00
parent 039409f9f5
commit b70b80bbea
3 changed files with 43 additions and 0 deletions

View File

@ -18,5 +18,10 @@ module.exports = (get_db) => ({
)
.from ('log')
.where ({ app_id });
},
insert (app_id, message, data = '{}', timestamp = (new Date)) {
const knex = get_db ();
return knex ('log')
.insert ({ message, data, timestamp, app_id });
}
});