stand2026_10_06
This commit is contained in:
1 parent
41f80ce947
commit
266f8c3b4f
199 files changed
+17061
-87
No files matched your search
@@ -0,0 +1,64 @@
|
||||
"use server"
|
||||
|
||||
import { ProConAnzeige, ProConAnzeigeVisuElement } from "@/types/procon/anzeigen";
|
||||
|
||||
|
||||
const url = "http://localhost:3000/procon/";
|
||||
const url_anzeigen = url + "anzeigen"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//--- Anzeigen
|
||||
//-----------------------------------------------------------------------------
|
||||
export async function api_ProconAnzeigen(): Promise<ProConAnzeige[]> {
|
||||
|
||||
const result = await fetch(`${url_anzeigen}`, {
|
||||
method: 'GET',
|
||||
headers: { 'Content-Type': 'application/json' }
|
||||
});
|
||||
|
||||
const data = await result.json();
|
||||
|
||||
return orderByDatenNummer(data);
|
||||
}
|
||||
|
||||
export async function api_ProconAnzeige_byId(id:number): Promise<ProConAnzeige> {
|
||||
|
||||
const result = await fetch(`${url_anzeigen}/byId/${id}`, {
|
||||
method: 'GET',
|
||||
headers: { 'Content-Type': 'application/json' }
|
||||
});
|
||||
|
||||
const data = await result.json();
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
export async function api_ProconAnzeige_byDatenNumber(id:number): Promise<ProConAnzeige> {
|
||||
|
||||
const result = await fetch(`${url_anzeigen}/byDatenNummer/${id}`, {
|
||||
method: 'GET',
|
||||
headers: { 'Content-Type': 'application/json' }
|
||||
});
|
||||
|
||||
const data = await result.json();
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
//--- Visu Elemente
|
||||
export async function api_ProconAnzeige_visuElements(id:number): Promise<ProConAnzeigeVisuElement[]> {
|
||||
|
||||
const result = await fetch(`${url_anzeigen}/VisuElements/${id}`, {
|
||||
method: 'GET',
|
||||
headers: { 'Content-Type': 'application/json' }
|
||||
});
|
||||
|
||||
const data = await result.json();
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
function orderByDatenNummer(data:ProConAnzeige[]) {
|
||||
return data.sort((a,b)=>a.DatenNummer-b.DatenNummer)
|
||||
}
|
||||
Reference in new issue
Block a user