Hinzufügen und Löschen Dialoge in den Tabellen hinzugefügt
This commit is contained in:
@@ -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}`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user