feat: Adds the ability to create a new article (#5255)

This commit is contained in:
Muhsin Keloth 2022-08-18 11:45:08 +05:30 committed by GitHub
parent 45d0d101b1
commit 0cd08065d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 117 additions and 36 deletions

View file

@ -32,6 +32,16 @@ class ArticlesAPI extends PortalsAPI {
articleObj
);
}
createArticle({ portalSlug, articleObj }) {
const { content, title, author_id, category_id } = articleObj;
return axios.post(`${this.url}/${portalSlug}/articles`, {
content,
title,
author_id,
category_id,
});
}
}
export default new ArticlesAPI();