Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | 1x 1x 1x 1x 1x 1x 1x 1x 1x | import {
PROPERTY_VALUES_SINGLE_REQUEST_TARGET,
PROPERTIES_REQUEST_TARGET,
Property,
PROPERTIES_SINGLE_REQUEST_TARGET,
} from '@/entities/property'
import { CollectionResponse } from '@/shared/@types'
import { getSingleRequestTarget, queryFetchFactory } from '@/shared/lib'
export const queryFetchPropertiesCollection = queryFetchFactory<CollectionResponse<Property>>(PROPERTIES_REQUEST_TARGET)
export const queryCreateProperty = queryFetchFactory<Omit<Property, 'unit'>>(PROPERTIES_REQUEST_TARGET, {
method: 'POST',
})
export const queryDeletePropertyValue = (id: string) =>
queryFetchFactory<Property>(getSingleRequestTarget(id, PROPERTY_VALUES_SINGLE_REQUEST_TARGET), {
method: 'DELETE',
})
export const queryUpdatePropertyValue = (id: string) =>
queryFetchFactory<Property>(getSingleRequestTarget(id, PROPERTY_VALUES_SINGLE_REQUEST_TARGET), {
method: 'PATCH',
})
export const queryFetchPropertyById = (id: string) =>
queryFetchFactory<Property>(getSingleRequestTarget(id, PROPERTIES_SINGLE_REQUEST_TARGET))
|