diff --git a/utils/api.tsx b/utils/api.tsx index 4817829a..683b2e71 100644 --- a/utils/api.tsx +++ b/utils/api.tsx @@ -4,7 +4,7 @@ interface Entity { name: string } -type CollectionEndpoint = (headers?: {}) => Promise> +type CollectionEndpoint = (params?: {}) => Promise> type IdEndpoint = ({ id }: { id: string }) => Promise> type IdWithObjectEndpoint = ({ id, object }: { id: string, object: string }) => Promise> type PostEndpoint = (object: {}, headers?: {}) => Promise> @@ -41,7 +41,7 @@ class Api { const resourceUrl = `${this.url}/${name}` return { - getAll: (headers?: {}) => axios.get(resourceUrl, headers), + getAll: (params?: {}) => axios.get(resourceUrl, params), getOne: ({ id }: { id: string }) => axios.get(`${resourceUrl}/${id}/`), getOneWithObject: ({ id, object }: { id: string, object: string }) => axios.get(`${resourceUrl}/${id}/${object}`), create: (object: {}, headers?: {}) => axios.post(resourceUrl, object, headers),