-
-
Save eyesofkids/f4cdd6d2a491ff6848e89581ff441d79 to your computer and use it in GitHub Desktop.
A simple interface for defining CRUD services
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export interface ICrudService<T> { | |
getAll: () => Promise<T[]>; | |
getOne: (id: string) => Promise<T | null>; | |
create: (data: T) => Promise<T>; | |
update: (id: string, data: T) => Promise<T>; | |
delete: (id: string) => Promise<T>; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment