// Track last edited article for highlighting window.TT_CONFIG.lastEditedArticleId = null; window.TT_CONFIG.CRUD_CONFIG.customRowClass = (row) => { const classes = []; if (row.isEndOfLife) classes.push('end-of-life'); if (window.TT_CONFIG.lastEditedArticleId && row.id == window.TT_CONFIG.lastEditedArticleId) { classes.push('last-edited-row'); } return classes.join(' '); } async function handleApiResponse(responsePromise) { const res = await responsePromise; if (!res.data.success) { const errors = res.data.errors; const errorMessage = Array.isArray(errors) ? errors.join(', ') : Object.values(errors).join(', '); return window.notify('error', `Fehler: ${errorMessage}`); } window.notify('success', res.data.message || 'Erfolgreich'); window.dispatchEvent(new Event('refreshTable')); } Vue.component('warehouse-article-prices', { props: { id: {type: Number, required: true}, cheapestPurchasePrice: {type: Number, default: null} }, template: `