Notes/src/entities/api_token.js

23 lines
494 B
JavaScript
Raw Normal View History

2018-04-01 17:38:24 -04:00
"use strict";
const Entity = require('./entity');
const utils = require('../services/utils');
class ApiToken extends Entity {
static get tableName() { return "api_tokens"; }
static get primaryKeyName() { return "apiTokenId"; }
beforeSaving() {
2018-04-02 20:30:00 -04:00
super.beforeSaving();
2018-04-01 17:38:24 -04:00
if (!this.isDeleted) {
this.isDeleted = false;
}
if (!this.dateCreated) {
this.dateCreated = utils.nowDate();
}
}
}
module.exports = ApiToken;