update license structures and init to setup image uploader
This commit is contained in:
@@ -28,8 +28,8 @@ export class ConsumersComponent extends AbstractList<IConsumerResponse> {
|
||||
field: 'license_expires_at',
|
||||
header: 'تاریخ انقضای لایسنس',
|
||||
customDataModel(item) {
|
||||
if (item.license) {
|
||||
return formatJalali(item.license.expires_at);
|
||||
if (item.license_info) {
|
||||
return formatJalali(item.license_info.expires_at);
|
||||
}
|
||||
return 'بدون لایسنس';
|
||||
},
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
|
||||
<superAdmin-consumer-license-form
|
||||
[(visible)]="visibleLicenseForm"
|
||||
[editMode]="!!licenseStatus()"
|
||||
[editMode]="!!license()?.id"
|
||||
[consumerId]="consumerId()"
|
||||
[licenseId]="license()?.id"
|
||||
[initialValues]="license() || undefined"
|
||||
|
||||
@@ -37,12 +37,16 @@ export class ConsumerComponent {
|
||||
|
||||
readonly loading = computed(() => this.store.loading());
|
||||
readonly consumer = computed(() => this.store.entity());
|
||||
readonly license = computed(() => this.store.entity()?.license);
|
||||
readonly license = computed(() => this.store.entity()?.license_info);
|
||||
readonly licenseStatus = computed(() => {
|
||||
if (!this.store.entity()?.license?.expires_at) {
|
||||
console.log(this.store.entity()?.license_info?.expires_at);
|
||||
|
||||
if (!this.store.entity()?.license_info?.expires_at) {
|
||||
return null;
|
||||
}
|
||||
if (new Date().getTime() > new Date(this.store.entity()?.license?.expires_at || '').getTime()) {
|
||||
if (
|
||||
new Date().getTime() > new Date(this.store.entity()?.license_info?.expires_at || '').getTime()
|
||||
) {
|
||||
return licenseStatus.EXPIRED;
|
||||
}
|
||||
return licenseStatus.ACTIVE;
|
||||
|
||||
Reference in New Issue
Block a user