Update connection metadata visibility
This commit is contained in:
parent
218f71b82c
commit
d90fd6b4e5
5745
pnpm-lock.yaml
generated
5745
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -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);
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
export interface ConnectionUpdateSchema {
|
||||
visibility?: boolean;
|
||||
show_activity?: boolean;
|
||||
metadata_visibility?: boolean;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user