import ky from 'ky' import type { PropertyGroup } from '../../data/propertyGroup' export const getPropertyGroups = async (): Promise => { return ky.get(`http://localhost:8088/propertygroups`).json() } export const getPropertyGroupById = async (id: number): Promise => { return ky.get(`http://localhost:8088/propertygroup/${id}`).json() } export const createPropertyGroup = async (propertyGroup: PropertyGroup): Promise => { return ky.post(`http://localhost:8088/propertygroup`, { json: propertyGroup }).json() } export const updatePropertyGroup = async (propertyGroup: PropertyGroup): Promise => { await ky.put(`http://localhost:8088/propertygroup`, { json: propertyGroup }) } export const deletePropertyGroup = async (id: number): Promise => { await ky.delete(`http://localhost:8088/propertygroup/${id}`) }