make pages/[user]/[type].tsx type-safe (#484)

* make `pages/[user]/[type].tsx` type-safe
* deprecate `whereAndSelect`
This commit is contained in:
Alex Johansson authored and GitHub committed 2021-08-18 12:21:52 +00:00
1 parent aed9757409
commit 2af160a13e
2 files changed
+85 -78

No files matched your search

+5
View File
@@ -27,6 +27,11 @@ const pluck = (select: Record<string, boolean>, attr: string) => {
};
};
/**
* @deprecated
* This function will always return `any` type,
* See https://github.com/calendso/calendso/pull/460 for alternative approach
*/
const whereAndSelect = (modelQuery, criteria: Record<string, unknown>, pluckedAttributes: string[]) =>
modelQuery({
where: criteria,