RestResource
interface RestResource<T, TCreate = Omit<T, 'id'>, TUpdate = Partial<TCreate>> {
create: ApiEndpoint<TCreate, T, void, void>;
delete: ApiEndpoint<void, void, { id: string }, void>;
get: ApiEndpoint<void, T, { id: string }, void>;
list: ApiEndpoint<void, T[], void, QueryParams<T>>;
update: ApiEndpoint<TUpdate, T, { id: string }, void>;
}Source: api.ts:393
REST resource endpoints
Type Parameters
T— Resource typeTCreate=Omit<T, "id">— Create input typeTUpdate=Partial<TCreate>— Update input type
Properties
create: ApiEndpoint<TCreate, T, void, void>
Create resource
delete: ApiEndpoint<void, void, { id: string }, void>
Delete resource
get: ApiEndpoint<void, T, { id: string }, void>
Get single resource
list: ApiEndpoint<void, T[], void, QueryParams<T>>
List resources
update: ApiEndpoint<TUpdate, T, { id: string }, void>
Update resource