feat: Adds image attachment for help center articles (#6426)
* Added one more endpoint to attach tempfile and get logo * Added one more endpoint to attach tempfile and get logo * spec fixes * Upload file for articles irrespective of the association * Upload file for articles irrespective of the association * Add multiple images with different keys * feat: Adds image attachment for help center articles * Adds validation for file upload * Fixes space above image after adding to doc * chore: Removed svg from file upload type * Update app/javascript/dashboard/components/widgets/WootWriter/FullEditor.vue Co-authored-by: Shivam Mishra <scm.mymail@gmail.com> * Update app/javascript/dashboard/components/widgets/WootWriter/FullEditor.vue Co-authored-by: Shivam Mishra <scm.mymail@gmail.com> * Removes caption for the image * Fixes woot prosemirror package version * Update yarn.lock * Update yarn.lock --------- Co-authored-by: Tejaswini Chile <tejaswini@chatwoot.com> Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com> Co-authored-by: iamsivin <iamsivin@gmail.com> Co-authored-by: Shivam Mishra <scm.mymail@gmail.com> Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
This commit is contained in:
committed by
GitHub
parent
80784e3cab
commit
2c8ecbeceb
@@ -46,6 +46,20 @@ class ArticlesAPI extends PortalsAPI {
|
||||
deleteArticle({ articleId, portalSlug }) {
|
||||
return axios.delete(`${this.url}/${portalSlug}/articles/${articleId}`);
|
||||
}
|
||||
|
||||
uploadImage({ portalSlug, file }) {
|
||||
let formData = new FormData();
|
||||
formData.append('background_image', file);
|
||||
return axios.post(
|
||||
`${this.url}/${portalSlug}/articles/attach_file`,
|
||||
formData,
|
||||
{
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data',
|
||||
},
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default new ArticlesAPI();
|
||||
|
||||
Reference in New Issue
Block a user