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,
|
ConnectionUpdateSchema,
|
||||||
DiscordApiErrors,
|
DiscordApiErrors,
|
||||||
emitEvent,
|
emitEvent,
|
||||||
} from "@spacevar/util";
|
} from "@spacebar/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
const router = Router();
|
const router = Router();
|
||||||
|
|
||||||
@ -44,6 +44,9 @@ router.patch(
|
|||||||
if (typeof body.show_activity === "boolean")
|
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?
|
//@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;
|
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);
|
connection.assign(req.body);
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
export interface ConnectionUpdateSchema {
|
export interface ConnectionUpdateSchema {
|
||||||
visibility?: boolean;
|
visibility?: boolean;
|
||||||
show_activity?: boolean;
|
show_activity?: boolean;
|
||||||
|
metadata_visibility?: boolean;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user