Sara
Sara5mo ago

Type check help - Passing an Object of type Doc<"table_name"> but has partial values

I'm basically wondering if there's another way of Doing this type here? where the body is supposed to be of type Doc<"settings"> but partially has that type?
export const update = mutation({
args:{settingsId: v.id("settings"), body:v.any()},
handler:async(ctx, args_0) => {
await ctx.db.patch(args_0.settingsId, args_0.body as Partial<Doc<"settings">>)
},
})
export const update = mutation({
args:{settingsId: v.id("settings"), body:v.any()},
handler:async(ctx, args_0) => {
await ctx.db.patch(args_0.settingsId, args_0.body as Partial<Doc<"settings">>)
},
})
2 Replies
Sara
SaraOP5mo ago
hey, sorry I replied to this late, but yep this is what I had been looking for, thanks!