feat: upload and delete client image (#1122)

Fixes: #1121
This commit is contained in:
Karan Takalkar
2020-07-17 12:10:57 +05:30
committed by GitHub
parent 9e859afe09
commit a13510dae1
8 changed files with 129 additions and 4 deletions
+12 -1
View File
@@ -151,7 +151,18 @@ export class ClientsService {
return this.http.skipErrorHandler().get(`/clients/${clientId}/images`, { params: httpParams, responseType: 'text' });
}
uploadClientSignature(clientId: string, signature: File) {
uploadClientProfileImage(clientId: string, image: File) {
const formData = new FormData();
formData.append('file', image);
formData.append('filename', 'file');
return this.http.post(`/clients/${clientId}/images`, formData);
}
deleteClientProfileImage(clientId: string) {
return this.http.delete(`/clients/${clientId}/images`);
}
uploadClientSignatureImage(clientId: string, signature: File) {
const formData = new FormData();
formData.append('file', signature);
formData.append('filename', signature.name);