Skip to content

Commit

Permalink
+
Browse files Browse the repository at this point in the history
  • Loading branch information
BlowaterNostr committed Apr 2, 2024
1 parent 8d627e7 commit f3f23db
Showing 1 changed file with 1 addition and 20 deletions.
21 changes: 1 addition & 20 deletions resolvers/root.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import { NostrKind } from "../_libs.ts";
import { PolicyStore } from "./policy.ts";
import { Policies } from "./policy.ts";
import { func_ResolvePolicyByKind } from "./policy.ts";

export const Mutation = (args: {
// resolvePolicyByKind: func_ResolvePolicyByKind;
policyStore: PolicyStore;
kv: Deno.Kv;
}) => {
Expand Down Expand Up @@ -34,23 +31,7 @@ export const Mutation = (args: {
await kv.set(["policy", args.kind], policy);
return policy;
},
set_policy: async (
args: {
kind: NostrKind;
read?: boolean;
write?: boolean;
},
) => {
const policy = await policyStore.resolvePolicyByKind(args.kind);
if (args.read != undefined) {
policy.read = args.read;
}
if (args.write != undefined) {
policy.write = args.write;
}
await kv.set(["policy", args.kind], policy);
return policy;
},
set_policy: policyStore.set_policy,
};
};

Expand Down

0 comments on commit f3f23db

Please sign in to comment.