cleanup + Property images
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user