Hinzufügen und Löschen Dialoge in den Tabellen hinzugefügt

This commit is contained in:
2026-08-09 19:39:41 +02:00
parent c5a82603ee
commit 3b1828291a
67 changed files with 991 additions and 3643 deletions
@@ -1,22 +1,22 @@
import ky from 'ky'
import type { propertyGroup } from '../../data/propertyGroup'
import type { PropertyGroup } from '../../data/propertyGroup'
export const getPropertyGroups = async (): Promise<propertyGroup[]> => {
return ky.get(`http://localhost:8088/propertygroups`).json<propertyGroup[]>()
export const getPropertyGroups = async (): Promise<PropertyGroup[]> => {
return ky.get(`http://localhost:8088/propertygroups`).json<PropertyGroup[]>()
}
export const getPropertyGroupById = async (id: number): Promise<propertyGroup> => {
return ky.get(`http://localhost:8088/propertygroup/${id}`).json<propertyGroup>()
export const getPropertyGroupById = async (id: number): Promise<PropertyGroup> => {
return ky.get(`http://localhost:8088/propertygroup/${id}`).json<PropertyGroup>()
}
export const createPropertyGroup = async (propertyGroup: propertyGroup): Promise<propertyGroup> => {
return ky.post(`http://localhost:8088/propertygroup`, { json: propertyGroup }).json<propertyGroup>()
export const createPropertyGroup = async (propertyGroup: PropertyGroup): Promise<PropertyGroup> => {
return ky.post(`http://localhost:8088/propertygroup`, { json: propertyGroup }).json<PropertyGroup>()
}
export const updatePropertyGroup = async (propertyGroup: propertyGroup): Promise<propertyGroup> => {
return ky.put(`http://localhost:8088/propertygroup`, { json: propertyGroup }).json<propertyGroup>()
export const updatePropertyGroup = async (propertyGroup: PropertyGroup): Promise<void> => {
await ky.put(`http://localhost:8088/propertygroup`, { json: propertyGroup })
}
export const deletePropertyGroup = async (id: number): Promise<void> => {
return ky.delete(`http://localhost:8088/propertygroup/${id}`).json<void>()
await ky.delete(`http://localhost:8088/propertygroup/${id}`)
}