Skip to content

Commit

Permalink
Merge pull request #401 from Sid-80/fix/readapi
Browse files Browse the repository at this point in the history
feat:remove validators
  • Loading branch information
subhadeeproy3902 authored Jul 2, 2024
2 parents a298466 + 8ad8183 commit 360b706
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions convex/files.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { v } from "convex/values";
import { mutation, query } from "./_generated/server";
import { Id } from "./_generated/dataModel";

export const createFile = mutation({
args: {
Expand Down Expand Up @@ -191,11 +192,7 @@ export const updateWrite = mutation({
});

export const updateRead = mutation({
args: {
_id: v.id("files"),
readBy: v.array(v.string())
},
handler: async (ctx, args) => {
handler: async (ctx, args:{_id : Id<"files">, readBy:string[]}) => {
const { _id,readBy } = args;
const res = await ctx.db.patch(_id, { readBy:readBy, write:false, read:true });
return res;
Expand Down

0 comments on commit 360b706

Please sign in to comment.