feat(ausruestungsanfrage): add personal item tracking, catalog enforcement, and detail pages
This commit is contained in:
@@ -11,6 +11,7 @@ import type {
|
||||
AusruestungWidgetOverview,
|
||||
CreateOrdersRequest,
|
||||
CreateOrdersResponse,
|
||||
UnassignedPosition,
|
||||
} from '../types/ausruestungsanfrage.types';
|
||||
|
||||
export const ausruestungsanfrageApi = {
|
||||
@@ -98,8 +99,9 @@ export const ausruestungsanfrageApi = {
|
||||
bezeichnung?: string,
|
||||
fuer_benutzer_id?: string,
|
||||
fuer_benutzer_name?: string,
|
||||
assignedItems?: { persoenlich_id: string; neuer_zustand: string }[],
|
||||
): Promise<AusruestungAnfrageDetailResponse> => {
|
||||
const r = await api.post('/api/ausruestungsanfragen/requests', { items, notizen, bezeichnung, fuer_benutzer_id, fuer_benutzer_name });
|
||||
const r = await api.post('/api/ausruestungsanfragen/requests', { items, notizen, bezeichnung, fuer_benutzer_id, fuer_benutzer_name, assignedItems });
|
||||
return r.data.data;
|
||||
},
|
||||
updateRequest: async (
|
||||
@@ -174,4 +176,15 @@ export const ausruestungsanfrageApi = {
|
||||
const r = await api.get('/api/ausruestungsanfragen/users');
|
||||
return r.data.data;
|
||||
},
|
||||
|
||||
// ── Position linking ──
|
||||
linkPositionToArtikel: async (positionId: number, artikelId: number): Promise<void> => {
|
||||
await api.patch(`/api/ausruestungsanfrage/positionen/${positionId}/artikel`, { artikel_id: artikelId });
|
||||
},
|
||||
|
||||
// ── Unassigned positions ──
|
||||
getUnassignedPositions: async (): Promise<UnassignedPosition[]> => {
|
||||
const r = await api.get<{ success: boolean; data: UnassignedPosition[] }>('/api/ausruestungsanfrage/nicht-zugewiesen');
|
||||
return r.data.data;
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user