From 6bf39b1c54c7ef8f4091a034abde03732074aece Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Sun, 27 Feb 2022 00:36:35 -0800 Subject: [PATCH] Update api.tsx --- utils/api.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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),