Merge remote-tracking branch 'origin/master'

This commit is contained in:
M_Kececi
2026-02-20 08:52:06 +03:00
parent f6b9793c41
commit d9c527d13f
10 changed files with 1254 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
// src/stores/OrderProductionItemStore.js
import { defineStore } from 'pinia'
import api from 'src/services/api'
export const useOrderProductionItemStore = defineStore('orderproductionitems', {
state: () => ({
items: [],
loading: false,
error: null
}),
actions: {
async fetchItems (orderHeaderID) {
if (!orderHeaderID) {
this.items = []
return
}
this.loading = true
this.error = null
try {
const res = await api.get(`/orders/production-items/${encodeURIComponent(orderHeaderID)}`)
const data = res?.data
this.items = Array.isArray(data) ? data : []
} catch (err) {
this.items = []
this.error = err?.response?.data || err?.message || 'Liste alınamadı'
} finally {
this.loading = false
}
}
}
})