summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2023-04-02 11:15:08 +1000
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2023-04-02 11:15:08 +1000
commitd90fd6b4e53eb056c579db736d9874f521319ba9 (patch)
tree9120fade51b13b419fc5bd87814202534c56a659 /src
parentMerge branch 'master' into refactor/dev/connections (diff)
downloadserver-d90fd6b4e53eb056c579db736d9874f521319ba9.tar.xz
Update connection metadata visibility
Diffstat (limited to 'src')
-rw-r--r--src/api/routes/users/@me/connections/#connection_name/#connection_id/index.ts5
-rw-r--r--src/util/schemas/ConnectionUpdateSchema.ts1
2 files changed, 5 insertions, 1 deletions
diff --git a/src/api/routes/users/@me/connections/#connection_name/#connection_id/index.ts b/src/api/routes/users/@me/connections/#connection_name/#connection_id/index.ts
index 6a8d31ca..afb0df06 100644
--- a/src/api/routes/users/@me/connections/#connection_name/#connection_id/index.ts
+++ b/src/api/routes/users/@me/connections/#connection_name/#connection_id/index.ts
@@ -4,7 +4,7 @@ import {
 	ConnectionUpdateSchema,
 	DiscordApiErrors,
 	emitEvent,
-} from "@spacevar/util";
+} from "@spacebar/util";
 import { Request, Response, Router } from "express";
 const router = Router();
 
@@ -44,6 +44,9 @@ router.patch(
 		if (typeof body.show_activity === "boolean")
 			//@ts-expect-error For some reason the client sends this as a boolean, even tho docs say its a number?
 			body.show_activity = body.show_activity ? 1 : 0;
+		if (typeof body.metadata_visibility === "boolean")
+			//@ts-expect-error For some reason the client sends this as a boolean, even tho docs say its a number?
+			body.metadata_visibility = body.metadata_visibility ? 1 : 0;
 
 		connection.assign(req.body);
 
diff --git a/src/util/schemas/ConnectionUpdateSchema.ts b/src/util/schemas/ConnectionUpdateSchema.ts
index eb6c0916..e1e6523a 100644
--- a/src/util/schemas/ConnectionUpdateSchema.ts
+++ b/src/util/schemas/ConnectionUpdateSchema.ts
@@ -1,4 +1,5 @@
 export interface ConnectionUpdateSchema {
 	visibility?: boolean;
 	show_activity?: boolean;
+	metadata_visibility?: boolean;
 }