cropper & imageservice

This commit is contained in:
2024-03-23 22:35:47 +01:00
parent d5210d3df4
commit a2c613c38f
11 changed files with 651 additions and 49 deletions

View File

@@ -0,0 +1,23 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class ImageService {
private uploadUrl = 'http://localhost:3000/bizmatch/image/uploadPropertyPicture/1a4b800e-793c-4c47-b987-7bf634060a4e';
constructor(private http: HttpClient) { }
uploadImage(imageBlob: Blob) {
const formData = new FormData();
formData.append('file', imageBlob, 'image.png');
return this.http.post(this.uploadUrl, formData,{
// headers: this.headers,
reportProgress: true,
observe: 'events',
});
}
}