fix(core): update
This commit is contained in:
@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@push.rocks/smartdata',
|
||||
version: '5.0.42',
|
||||
version: '5.0.43',
|
||||
description: 'do more with data'
|
||||
}
|
||||
|
@ -188,6 +188,18 @@ export class SmartDataDbDoc<T extends TImplements, TImplements, TManager extends
|
||||
*/
|
||||
public creationStatus: TDocCreation = 'new';
|
||||
|
||||
/**
|
||||
* updated from db in any case where doc comes from db
|
||||
*/
|
||||
@svDb()
|
||||
_createdAt: number = Date.now();
|
||||
|
||||
/**
|
||||
* will be updated everytime the doc is saved
|
||||
*/
|
||||
@svDb()
|
||||
_updatedAt: number = Date.now();
|
||||
|
||||
/**
|
||||
* unique indexes
|
||||
*/
|
||||
@ -221,6 +233,9 @@ export class SmartDataDbDoc<T extends TImplements, TImplements, TManager extends
|
||||
// tslint:disable-next-line: no-this-assignment
|
||||
const self: any = this;
|
||||
let dbResult: any;
|
||||
|
||||
this._updatedAt = Date.now();
|
||||
|
||||
switch (this.creationStatus) {
|
||||
case 'db':
|
||||
dbResult = await this.collection.update(self);
|
||||
|
Reference in New Issue
Block a user