Better Chat
All checks were successful
Build and Release / build-and-release (push) Successful in 11m38s
All checks were successful
Build and Release / build-and-release (push) Successful in 11m38s
This commit is contained in:
@@ -113,6 +113,26 @@ export const send = mutation({
|
||||
},
|
||||
});
|
||||
|
||||
export const sendBatch = mutation({
|
||||
args: {
|
||||
messages: v.array(v.object({
|
||||
channelId: v.id("channels"),
|
||||
senderId: v.id("userProfiles"),
|
||||
ciphertext: v.string(),
|
||||
nonce: v.string(),
|
||||
signature: v.string(),
|
||||
keyVersion: v.number(),
|
||||
})),
|
||||
},
|
||||
returns: v.object({ count: v.number() }),
|
||||
handler: async (ctx, args) => {
|
||||
for (const msg of args.messages) {
|
||||
await ctx.db.insert("messages", { ...msg });
|
||||
}
|
||||
return { count: args.messages.length };
|
||||
},
|
||||
});
|
||||
|
||||
export const edit = mutation({
|
||||
args: {
|
||||
id: v.id("messages"),
|
||||
|
||||
Reference in New Issue
Block a user