Skip to content

Commit

Permalink
+
Browse files Browse the repository at this point in the history
  • Loading branch information
bob2402 committed Jun 17, 2024
1 parent 4385f8d commit 94a8874
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
6 changes: 2 additions & 4 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ const graphql_login_handler =
}
const error = await verifyToken(body, args.relayInformationStore);
if (error instanceof Error) {
return new Response(JSON.stringify(error.message), { status: 400 });
return new Response(error.message, { status: 400 });
} else {
const auth = btoa(JSON.stringify(body));
const headers = new Headers();
Expand All @@ -433,9 +433,7 @@ const members_handler = async (args: { get_space_members: func_GetSpaceMembers }
console.error(members);
return new Response("", { status: 500 });
}
const resp = new Response(JSON.stringify(members.map((event) => event.member)), {
status: 200,
});
const resp = new Response(JSON.stringify(members), { status: 200 });
resp.headers.set("content-type", "application/json; charset=utf-8");
resp.headers.set("Access-Control-Allow-Origin", "*");
resp.headers.set("Access-Control-Allow-Methods", "GET");
Expand Down
3 changes: 0 additions & 3 deletions resolvers/policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,6 @@ export const get_space_members = (db: DB): func_GetSpaceMembers => async () => {

export const add_space_member =
(args: { admin: PublicKey; db: DB }): func_AddSpaceMember => async (event: SpaceMember) => {
if (!(await verify_event_v2(event))) {
return new Error("Event verification failed");
}
if (event.pubkey != args.admin.hex) {
return new Error("Only administrators can add members to the space.");
}
Expand Down

0 comments on commit 94a8874

Please sign in to comment.