Refactor APIService into generic interface

This commit is contained in:
Tee
2021-02-26 10:56:55 -05:00
parent f30b2313fe
commit 2f186599dd

View File

@ -1,7 +1,7 @@
import { Query } from "./query";
export interface APIService {
find: <T>(id: string) => Promise<T[]>;
all: <T>() => Promise<T[]>;
where: <T>(params: Query[]) => Promise<T[]>;
export interface APIService<T> {
find: (id: string) => Promise<T[]>;
all: () => Promise<T[]>;
where: (params: Query[]) => Promise<T[]>;
}