cleanup + Property images

This commit is contained in:
2024-05-05 15:30:10 +02:00
parent 9121ca1a69
commit bb5a408cdc
34 changed files with 1668 additions and 256 deletions

View File

@@ -56,14 +56,13 @@ export class FileService {
return fs.existsSync(`./pictures/logo/${userId}.avif`)?true:false
}
async getPropertyImages(listingId: string): Promise<ImageProperty[]> {
const result: ImageProperty[] = []
async getPropertyImages(listingId: string): Promise<string[]> {
const result: string[] = []
const directory = `./pictures/property/${listingId}`
if (fs.existsSync(directory)) {
const files = await fs.readdir(directory);
files.forEach(f => {
const image: ImageProperty = { name: f, id: '', code: '' };
result.push(image)
result.push(f)
})
return result;
} else {