u
This commit is contained in:
@@ -257,9 +257,9 @@ export const article = {
|
||||
|
||||
/**
|
||||
* PATCH /api/article/:sku
|
||||
* Body: at least one of { name, unitamount, unitSi, track_stock }
|
||||
* Body: at least one of { name, unitamount, unitSi, track_stock, desc, seo }
|
||||
* unitSi must exist for selected company → 404 Unit not found
|
||||
* → 200 { article } (same detail shape as GET)
|
||||
* → 200 { article } (same detail shape as GET: includes desc, seo)
|
||||
*/
|
||||
update(sku, body) {
|
||||
return http(`/api/article/${encodeURIComponent(sku)}`, {
|
||||
|
||||
@@ -152,7 +152,7 @@ const actions = {
|
||||
* does not flicker, then rolled back from the server on failure.
|
||||
*
|
||||
* @param {string} sku Article SKU.
|
||||
* @param {object} body Patch body (`{ name?, unitamount?, unitSi?, track_stock? }`).
|
||||
* @param {object} body Patch body (`{ name?, unitamount?, unitSi?, track_stock?, desc?, seo? }`).
|
||||
* @returns {Promise<object>} Response body containing the fresh `article`.
|
||||
*/
|
||||
async update(sku, body) {
|
||||
|
||||
@@ -21,12 +21,13 @@ function PanelValue({ label, children }) {
|
||||
export default class ArticleSeoTab extends Component {
|
||||
render() {
|
||||
const { article: articleData } = this.props;
|
||||
const seo = articleData.seo ?? articleData.seoDescription;
|
||||
const desc = articleData.desc ?? articleData.description;
|
||||
return (
|
||||
<>
|
||||
<PanelValue label="Slug">{articleData.slug}</PanelValue>
|
||||
<PanelValue label="SEO-Titel">{articleData.seoTitle}</PanelValue>
|
||||
<PanelValue label="SEO-Beschreibung">{articleData.seoDescription}</PanelValue>
|
||||
<PanelValue label="Beschreibung">{articleData.description}</PanelValue>
|
||||
<PanelValue label="SEO">{seo}</PanelValue>
|
||||
<PanelValue label="Beschreibung">{desc}</PanelValue>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user