feat: Update API for contact avatar (#4719)

Added the ability to update the contact's avatar via API and Dashboard.

- Contact create and update APIs can now accept avatar attachment parameters [form data].
- Contact create and update endpoints can now accept the avatar_url parameter.[json]
- API endpoint to remove a contact avatar.
- Updated Contact create/edit UI components with avatar support

Fixes: #3428
This commit is contained in:
giquieu 2022-07-12 05:03:16 -03:00 committed by GitHub
parent 68fcd28751
commit 827f977a37
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 283 additions and 28 deletions

View file

@ -3,12 +3,18 @@
<label>
<span v-if="label">{{ label }}</span>
</label>
<woot-thumbnail v-if="src" size="80px" :src="src" />
<woot-thumbnail
v-if="src"
size="80px"
:src="src"
:username="usernameAvatar"
/>
<div v-if="src && deleteAvatar" class="avatar-delete-btn">
<woot-button
color-scheme="alert"
variant="hollow"
size="tiny"
type="button"
@click="onAvatarDelete"
>
{{ this.$t('INBOX_MGMT.DELETE.AVATAR_DELETE_BUTTON_TEXT') }}
@ -38,6 +44,10 @@ export default {
type: String,
default: '',
},
usernameAvatar: {
type: String,
default: '',
},
deleteAvatar: {
type: Boolean,
default: false,
@ -50,7 +60,7 @@ export default {
this.$emit('change', {
file,
url: URL.createObjectURL(file),
url: file ? URL.createObjectURL(file) : null,
});
},
onAvatarDelete() {