Update connection metadata visibility

This commit is contained in:
Madeline 2023-04-02 11:15:08 +10:00
parent 218f71b82c
commit d90fd6b4e5
No known key found for this signature in database
GPG Key ID: 1958E017C36F2E47
3 changed files with 5 additions and 5746 deletions

5745
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -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);

View File

@ -1,4 +1,5 @@
export interface ConnectionUpdateSchema {
visibility?: boolean;
show_activity?: boolean;
metadata_visibility?: boolean;
}