first commit

This commit is contained in:
2024-05-16 16:05:41 +02:00
commit adf8283ae0
197 changed files with 26666 additions and 0 deletions
@@ -0,0 +1,68 @@
import { Component, OnInit, Inject } from '@angular/core';
import {MatDialogRef, MAT_DIALOG_DATA} from '@angular/material/dialog';
import * as moment from 'moment-timezone';
//Services
import { apiService } from 'src/app/core/services/api.service';
// Models
import { SaleInfo } from 'src/app/core/services/model/saleInfo.interface';
@Component({
selector: 'loading-sale-dialog-dialog',
templateUrl: './loading-sale-dialog.component.html',
styleUrls: ['./loading-sale-dialog.component.css']
})
export class LoadingSaleDialogComponent implements OnInit {
url: string = '';
SaleInfo: SaleInfo;
date: Date;
hour: string = "";
constructor(
private apiService: apiService,
public dialogRef: MatDialogRef<LoadingSaleDialogComponent>,
@Inject(MAT_DIALOG_DATA) public data: any) {
this.SaleInfo = {
_id: "",
idPlatform: "",
platform: "",
url: "",
title: "",
date: "",
location: "",
saleHouseName: "",
status: ""
};
this.date = new Date();
}
ngOnInit(): void {
this.url = this.data.url;
console.log(this.url);
this.apiService.getSaleInfos(this.url).subscribe( SaleInfo => {
console.log(SaleInfo);
this.SaleInfo = SaleInfo;
//hour
// Europe/Paris is the timezone of the user
this.date = moment(this.SaleInfo.date).tz('Europe/Paris').toDate();
this.hour = moment(this.SaleInfo.date).tz('Europe/Paris').format('HH:mm');
}
);
}
save(): void {
this.apiService.saveSale(this.SaleInfo).subscribe( SaleInfo => {
this.dialogRef.close(true);
});
}
cancel(): void {
this.dialogRef.close(false);
}
}