You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to create a seeding utility that wraps a bunch of logic and then calls db.blogPosts.create function. How would I type the functions arguments blogPostCreateOverrides below?
functionseedBlogPost(blogPostCreateOverrides: unknown){// do stuffdb.blogs.create(blogPostCreateOverrides)}
Similarly, I need a utility function that takes in a blogPost, what should be the type of that? BlogPost could be:
But surely there has to be a cleaner way
function convertV2BlogPostToV1Version(blogPost: ReturnType<db.blogpost.create>) {
// do stuff
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Given the following setup:
I'm trying to create a seeding utility that wraps a bunch of logic and then calls db.blogPosts.create function. How would I type the functions arguments
blogPostCreateOverrides
below?Similarly, I need a utility function that takes in a blogPost, what should be the type of that? BlogPost could be:
But surely there has to be a cleaner way
Beta Was this translation helpful? Give feedback.
All reactions