shared catalog in Bestellungen, catalog picker in line items, Ersatzbeschaffung flag, vendor detail flash fix
This commit is contained in:
@@ -122,6 +122,10 @@ export const ausruestungsanfrageApi = {
|
||||
await api.patch(`/api/ausruestungsanfragen/positionen/${positionId}/geliefert`, { geliefert });
|
||||
},
|
||||
|
||||
updatePositionZurueckgegeben: async (positionId: number, altes_geraet_zurueckgegeben: boolean): Promise<void> => {
|
||||
await api.patch(`/api/ausruestungsanfragen/positionen/${positionId}/zurueckgegeben`, { altes_geraet_zurueckgegeben });
|
||||
},
|
||||
|
||||
// ── Linking ──
|
||||
linkToOrder: async (anfrageId: number, bestellungId: number): Promise<void> => {
|
||||
await api.post(`/api/ausruestungsanfragen/requests/${anfrageId}/link`, { bestellung_id: bestellungId });
|
||||
|
||||
@@ -12,6 +12,7 @@ import type {
|
||||
ErinnerungFormData,
|
||||
BestellungHistorie,
|
||||
} from '../types/bestellung.types';
|
||||
import type { AusruestungArtikel, AusruestungEigenschaft } from '../types/ausruestungsanfrage.types';
|
||||
|
||||
export const bestellungApi = {
|
||||
// ── Vendors ──
|
||||
@@ -120,4 +121,21 @@ export const bestellungApi = {
|
||||
const r = await api.get('/api/permissions/users-with', { params: { permission: 'bestellungen:create' } });
|
||||
return r.data.data;
|
||||
},
|
||||
|
||||
// ── Catalog ──
|
||||
getKatalogItems: async (filters?: { search?: string; kategorie?: string }): Promise<AusruestungArtikel[]> => {
|
||||
const params = new URLSearchParams();
|
||||
if (filters?.search) params.set('search', filters.search);
|
||||
if (filters?.kategorie) params.set('kategorie', filters.kategorie);
|
||||
const r = await api.get(`/api/bestellungen/katalog/items?${params.toString()}`);
|
||||
return r.data.data;
|
||||
},
|
||||
getKatalogItem: async (id: number): Promise<AusruestungArtikel> => {
|
||||
const r = await api.get(`/api/bestellungen/katalog/items/${id}`);
|
||||
return r.data.data;
|
||||
},
|
||||
getKatalogKategorien: async (): Promise<string[]> => {
|
||||
const r = await api.get('/api/bestellungen/katalog/kategorien');
|
||||
return r.data.data;
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user