open-vault/ui/app/models/secret-v2-version.js
Angel Garbarino b4d9ee60d8
KV spelling error on destroy (#13313)
* fix spelling error

* add test coverage

* whoops

* browserstack fail
2021-11-30 15:31:02 -07:00

22 lines
564 B
JavaScript

import { belongsTo, attr } from '@ember-data/model';
import SecretModel from './secret';
export default class SecretV2VersionModel extends SecretModel {
@attr('boolean') failedServerRead;
@attr('number') version;
@attr('string') path;
@attr('string') deletionTime;
@attr('string') createdTime;
@attr('boolean') destroyed;
@attr('number') currentVersion;
@belongsTo('secret-v2') secret;
pathAttr = 'path';
get deleted() {
const deletionTime = new Date(this.deletionTime);
const now = new Date();
return deletionTime <= now;
}
}