Created
October 10, 2022 20:55
-
-
Save brandonchadlange/5f6aa2f51107eef84ab526f658ddc6ff to your computer and use it in GitHub Desktop.
A simple interface for defining CRUD services
This file contains 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
🚀