mirror of
https://github.com/spacebarchat/server.git
synced 2026-10-03 10:48:22 +00:00
Some schema fixes
This commit is contained in:
@@ -78,7 +78,7 @@ router.get(
|
||||
},
|
||||
responses: {
|
||||
200: {
|
||||
body: "PublicMessageArray",
|
||||
body: "PublicMessageListResponse",
|
||||
},
|
||||
400: {
|
||||
body: "APIErrorResponse",
|
||||
|
||||
@@ -165,7 +165,7 @@ router.get(
|
||||
permission: ["READ_MESSAGE_HISTORY"],
|
||||
responses: {
|
||||
200: {
|
||||
body: "PublicMessageArray",
|
||||
body: "PublicMessageListResponse",
|
||||
},
|
||||
400: {
|
||||
body: "APIErrorResponse",
|
||||
|
||||
@@ -166,7 +166,7 @@ router.get(
|
||||
permission: ["READ_MESSAGE_HISTORY"],
|
||||
responses: {
|
||||
200: {
|
||||
body: "PublicMessageArray",
|
||||
body: "PublicMessageListResponse",
|
||||
},
|
||||
400: {
|
||||
body: "APIErrorResponse",
|
||||
|
||||
@@ -34,7 +34,7 @@ router.get(
|
||||
permission: "MANAGE_WEBHOOKS",
|
||||
responses: {
|
||||
200: {
|
||||
body: "WebhookArray",
|
||||
body: "WebhookListResponse",
|
||||
},
|
||||
},
|
||||
}),
|
||||
|
||||
@@ -20,7 +20,7 @@ import { Request, Response, Router } from "express";
|
||||
import { route } from "@spacebar/api/middlewares";
|
||||
import { Message } from "@spacebar/database";
|
||||
import { Config } from "@spacebar/util";
|
||||
import { PreloadMessagesRequestSchema, PublicMessageArray } from "@spacebar/schemas";
|
||||
import { PreloadMessagesRequestSchema, PublicMessageListResponse } from "@spacebar/schemas";
|
||||
|
||||
const router = Router({ mergeParams: true });
|
||||
|
||||
@@ -30,7 +30,7 @@ router.post(
|
||||
requestBody: "PreloadMessagesRequestSchema",
|
||||
responses: {
|
||||
200: {
|
||||
body: "PublicMessageArray",
|
||||
body: "PublicMessageListResponse",
|
||||
},
|
||||
400: {
|
||||
body: "APIErrorResponse",
|
||||
@@ -62,7 +62,7 @@ router.post(
|
||||
// https://docs.discord.food/resources/message#preload-messages - reactions are not included in the response
|
||||
x.reactions = undefined;
|
||||
return x;
|
||||
}) as unknown as PublicMessageArray;
|
||||
}) as unknown as PublicMessageListResponse;
|
||||
|
||||
return res.status(200).send(filteredMessages);
|
||||
},
|
||||
|
||||
@@ -42,7 +42,7 @@ router.get(
|
||||
},
|
||||
responses: {
|
||||
200: {
|
||||
body: "PublicMemberArray",
|
||||
body: "PublicMemberListResponse",
|
||||
},
|
||||
403: {
|
||||
body: "APIErrorResponse",
|
||||
|
||||
@@ -31,7 +31,7 @@ router.get(
|
||||
permission: "MANAGE_WEBHOOKS",
|
||||
responses: {
|
||||
200: {
|
||||
body: "WebhookArray",
|
||||
body: "WebhookListResponse",
|
||||
},
|
||||
},
|
||||
}),
|
||||
|
||||
@@ -27,7 +27,7 @@ router.get(
|
||||
route({
|
||||
responses: {
|
||||
200: {
|
||||
body: "APIPublicUser",
|
||||
body: "PublicUser",
|
||||
},
|
||||
},
|
||||
}),
|
||||
|
||||
@@ -30,7 +30,7 @@ router.get(
|
||||
route({
|
||||
responses: {
|
||||
200: {
|
||||
body: "APIPrivateUser",
|
||||
body: "PrivateUser",
|
||||
},
|
||||
},
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user