mirror of
https://github.com/spacebarchat/server.git
synced 2026-06-04 08:41:36 +00:00
Try to enforce channel limts?
This commit is contained in:
@@ -20,4 +20,5 @@ export class ChannelLimits {
|
||||
maxPins: number = 500;
|
||||
maxTopic: number = 1024;
|
||||
maxWebhooks: number = 100;
|
||||
maxName: number = 32;
|
||||
}
|
||||
|
||||
@@ -28,6 +28,10 @@ export type ErrorList = Record<string, ObjectErrorContent>;
|
||||
export type ErrorContent = { code: string; message: string };
|
||||
export type ObjectErrorContent = { _errors: ErrorContent[] };
|
||||
|
||||
export function makeObjectErrorContent(code: string, message: string): ObjectErrorContent {
|
||||
return { _errors: [{ code, message }] };
|
||||
}
|
||||
|
||||
export function FieldErrors(fields: Record<string, { code?: string; message: string }>, errors?: ErrorObject[]) {
|
||||
const errorObj: ErrorList = {};
|
||||
for (const [key, { message, code }] of Object.entries(fields)) {
|
||||
|
||||
Reference in New Issue
Block a user